21 lines
274 B
Python
21 lines
274 B
Python
from pydantic import BaseModel
|
|
|
|
|
|
class ItemBase(BaseModel):
|
|
title: str
|
|
description: str | None = None
|
|
|
|
|
|
class Item(ItemBase):
|
|
id: int
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class ItemCreate(ItemBase):
|
|
pass
|
|
|
|
|
|
class ItemUpdate(ItemBase):
|
|
pass
|