yinkaiot / app /schemas.py
okeowo1014's picture
Upload 18 files
dc65e63 verified
# fastapi_crud/app/schemas.py
from pydantic import BaseModel
class UserBase(BaseModel):
username: str
class UserCreate(UserBase):
password: str
class User(UserBase):
id: int
is_active: bool
class Config:
orm_mode = True
class DeviceBase(BaseModel):
channel: int
name: str
rating: int
location: str
active: bool = False
class DeviceCreate(DeviceBase):
pass
class DeviceUpdate(DeviceBase):
pass
class Device(DeviceBase):
id: int
class Config:
orm_mode = True