Add api func
This commit is contained in:
50
schemas.py
Normal file
50
schemas.py
Normal file
@@ -0,0 +1,50 @@
|
||||
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
|
||||
Reference in New Issue
Block a user