18 lines
336 B
Python
18 lines
336 B
Python
from pydantic import BaseModel # pylint: disable=no-name-in-module
|
|
|
|
|
|
# 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
|