fastfood/fastfood/schemas.py

30 lines
468 B
Python
Raw Normal View History

from decimal import Decimal
2024-01-20 03:29:15 +03:00
from typing import List, Optional
from uuid import UUID
from pydantic import BaseModel
class MenuBase(BaseModel):
title: str
2024-01-20 03:29:15 +03:00
description: Optional[str]
class Config:
2024-01-20 03:29:15 +03:00
from_attributes = True
class Menu(MenuBase):
2024-01-20 03:29:15 +03:00
id: UUID
title: str
description: Optional[str]
# submenus: Optional[List[SubMenu]]
class Config:
2024-01-20 03:29:15 +03:00
from_attributes = True
class SubmenuBase(MenuBase):
pass