device.py 337 B

12345678910111213141516171819202122232425262728
  1. from pydantic import BaseModel
  2. class DeviceBase(BaseModel):
  3. pass
  4. class DeviceCreate(DeviceBase):
  5. id: str
  6. class DeviceUpdate(DeviceBase):
  7. pass
  8. class DeviceInDBBase(DeviceBase):
  9. id: str
  10. class Config:
  11. orm_mode = True
  12. class Device(DeviceInDBBase):
  13. pass
  14. class DeviceInDB(DeviceInDBBase):
  15. pass