20 lines
265 B
Python
20 lines
265 B
Python
from typing import Union
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class UserBase(BaseModel):
|
|
username: str
|
|
email: str
|
|
|
|
|
|
class UserCreate(UserBase):
|
|
password: str
|
|
|
|
|
|
class User(UserBase):
|
|
id: int
|
|
is_active: bool
|
|
|
|
class Config:
|
|
orm_mode = True
|