18 lines
299 B
Python
18 lines
299 B
Python
from pydantic import BaseModel
|
|
|
|
|
|
# Pydantic class for
|
|
# INSERT queries on a User model
|
|
class UserCreate(BaseModel):
|
|
email: str
|
|
name: str
|
|
age: int
|
|
|
|
|
|
# Pydantic class for
|
|
# SELECT responses with User model(-s)
|
|
class User(UserCreate):
|
|
id: int
|
|
|
|
class Config:
|
|
orm_mode = True
|