File size: 532 Bytes
4ee0abb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
784bc54
 
4ee0abb
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from pydantic import BaseModel

class MealBase(BaseModel):
    name: str
    description: str
    price: float

class MealCreate(MealBase):
    pass

class MealUpdate(MealBase):
    pass

class Meal(MealBase):
    id: int

    class Config:
        orm_mode = True

class OrderBase(BaseModel):
    quantity: int

class OrderCreate(OrderBase):
    meal_id: int

class Order(OrderBase):
    id: int
    user_id: int  # Corrected type annotation
    meal_id: int  # Corrected type annotation

    class Config:
        orm_mode = True