crappy
This commit is contained in:
@@ -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
16
schemas/client.py
Normal 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]
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user