50 lines
990 B
Python
50 lines
990 B
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
|
|
# Pydantic модель для Auditory
|
|
class AuditoryBase(BaseModel):
|
|
audnazvanie: str
|
|
|
|
class AuditoryCreate(AuditoryBase):
|
|
pass
|
|
|
|
class Auditory(AuditoryBase):
|
|
id: int
|
|
|
|
class Config:
|
|
from_attributes = True # Ранее называлось `orm_mode = True`
|
|
|
|
# Pydantic модель для Oboruds
|
|
class OborudsBase(BaseModel):
|
|
invNumber: int
|
|
nazvanie: str
|
|
raspologenie: str
|
|
numberved: str
|
|
numberppasu: str
|
|
kolichestvo: int
|
|
balancenumber: int
|
|
aud_id: int
|
|
|
|
class OborudsCreate(OborudsBase):
|
|
pass
|
|
|
|
class Oboruds(OborudsBase):
|
|
id: int
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
# Pydantic модель для Zametki
|
|
class ZametkiBase(BaseModel):
|
|
txtzam: str
|
|
rmdt: datetime | None = None
|
|
|
|
class ZametkiCreate(ZametkiBase):
|
|
pass
|
|
|
|
class Zametki(ZametkiBase):
|
|
id: int
|
|
created_date: datetime
|
|
|
|
class Config:
|
|
from_attributes = True |