item.py 239 B

123456789101112131415161718
  1. from pydantic import BaseModel
  2. class ItemBase(BaseModel):
  3. title: str
  4. description: str | None
  5. class ItemCreate(ItemBase):
  6. pass
  7. class Item(ItemBase):
  8. id: int
  9. owner_id: int
  10. class Config:
  11. orm_mode = True