fastapi-boilerplate/app/schemas/schemas.py

22 lines
274 B
Python
Raw Normal View History

2023-08-10 22:46:36 +02:00
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