Creating stubs and defining schemas
This commit is contained in:
23
back/schemas.py
Normal file
23
back/schemas.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class PeopleCreate(BaseModel):
|
||||
name: str
|
||||
age: int
|
||||
gender: str
|
||||
country: str
|
||||
|
||||
|
||||
class AverageAgeByCountry(BaseModel):
|
||||
country: str
|
||||
average_age: float
|
||||
|
||||
|
||||
class CountByCountry(BaseModel):
|
||||
country: str
|
||||
people_count: int
|
||||
|
||||
|
||||
class GenderRepartition(BaseModel):
|
||||
female_proportion: float
|
||||
male_proportion: float
|
||||
Reference in New Issue
Block a user