This commit is contained in:
2024-03-04 04:15:01 +03:00
parent d870f1cffe
commit bf24c791fc
12 changed files with 116 additions and 13 deletions

View File

@@ -1,5 +1,12 @@
from pydantic import BaseModel
class CustomConfig:
populate_by_name = True
from_attributes = True
class CustomModel(BaseModel):
pass
class Config:
from_attributes = True

16
schemas/client.py Normal file
View File

@@ -0,0 +1,16 @@
from typing import List
from schemas.base import CustomModel
class ClientSchema(CustomModel):
id: int
name: str
class ClientSearchRequest(CustomModel):
name: str
class ClientSearchResponse(CustomModel):
clients: List[ClientSchema]

View File

@@ -1,4 +1,7 @@
import datetime
from schemas.base import CustomModel
from schemas.client import ClientSchema
class DealChangeStatusRequest(CustomModel):
@@ -16,3 +19,10 @@ class DealCreateRequest(CustomModel):
class DealCreateResponse(CustomModel):
ok: bool
class FastDeal(CustomModel):
name: str
client: ClientSchema
comment: str
acceptance_date: datetime.datetime