python-test/Module 5/schemas/items.py

9 lines
No EOL
187 B
Python

from pydantic import BaseModel, ConfigDict
class ItemIn(BaseModel):
text: str
class ItemOut(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: int
text: str