♻ Move project source files to top level from src, update Sentry dependency (#630)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
35
backend/app/schemas/item.py
Normal file
35
backend/app/schemas/item.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
# Shared properties
|
||||
class ItemBase(BaseModel):
|
||||
title: str | None = None
|
||||
description: str | None = None
|
||||
|
||||
|
||||
# Properties to receive on item creation
|
||||
class ItemCreate(ItemBase):
|
||||
title: str
|
||||
|
||||
|
||||
# Properties to receive on item update
|
||||
class ItemUpdate(ItemBase):
|
||||
pass
|
||||
|
||||
|
||||
# Properties shared by models stored in DB
|
||||
class ItemInDBBase(ItemBase):
|
||||
id: int
|
||||
title: str
|
||||
owner_id: int
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
# Properties to return to client
|
||||
class Item(ItemInDBBase):
|
||||
pass
|
||||
|
||||
|
||||
# Properties properties stored in DB
|
||||
class ItemInDB(ItemInDBBase):
|
||||
pass
|
Reference in New Issue
Block a user