【问题标题】:What is the field type of image in defining a schema in pydantic?在 pydantic 中定义模式时,图像的字段类型是什么?
【发布时间】:2022-07-31 18:02:13
【问题描述】:
from fastapi import Body, FastAPI
from pydantic import BaseModel

class Validate(BaseModel):
    
    Product_Name : str
    Discription : str
    image : #what would be the tyoe of this image

【问题讨论】:

  • 没有任何上下文是不可能回答的。

标签: python api fastapi pydantic


【解决方案1】:

我想它以二进制形式存储在您的后端数据库中,因此要使用的 python 类型是字节

【讨论】:

    猜你喜欢
    • 2018-11-23
    • 2021-01-29
    • 1970-01-01
    • 2021-09-06
    • 2022-01-15
    • 2020-09-14
    • 2022-10-13
    • 1970-01-01
    • 2014-04-27
    相关资源
    最近更新 更多