32 lines
577 B
Python
32 lines
577 B
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
|
|
|
|
class TableBase(BaseModel):
|
|
number: int
|
|
label: Optional[str] = None
|
|
is_active: bool = True
|
|
|
|
|
|
class TableCreate(TableBase):
|
|
pass
|
|
|
|
|
|
class TableUpdate(BaseModel):
|
|
number: Optional[int] = None
|
|
label: Optional[str] = None
|
|
is_active: Optional[bool] = None
|
|
|
|
|
|
class TableFloorplanUpdate(BaseModel):
|
|
floor_x: float
|
|
floor_y: float
|
|
|
|
|
|
class TableOut(TableBase):
|
|
id: int
|
|
floor_x: Optional[float] = None
|
|
floor_y: Optional[float] = None
|
|
|
|
model_config = {"from_attributes": True}
|