2025-05-26 19:04:54 +00:00

56 lines
723 B
Python

from typing import Optional
from app.schemas.base import BaseSchema
class ItemBase(BaseSchema):
"""
Base schema for an item.
"""
title: Optional[str] = None
description: Optional[str] = None
class ItemCreate(ItemBase):
"""
Schema for creating a new item.
"""
title: str
class ItemUpdate(ItemBase):
"""
Schema for updating an item.
"""
pass
class ItemInDBBase(ItemBase):
"""
Schema for an item in the database.
"""
id: int
title: str
owner_id: int
class Item(ItemInDBBase):
"""
Schema for returning an item.
"""
pass
class ItemInDB(ItemInDBBase):
"""
Schema for an item in the database.
"""
pass