Source code for app.schemas.user

from typing import Optional

from pydantic import BaseModel


# Shared properties
[docs]class UserBase(BaseModel): is_active: Optional[bool] = True is_superuser: bool = False
# Properties to receive via API on creation
[docs]class UserCreate(UserBase): user_name: str password: str
# Properties to receive via API on update
[docs]class UserUpdate(UserBase): password: Optional[str] = None
[docs]class UserInDBBase(UserBase): id: Optional[int] = None
[docs] class Config: orm_mode = True
# Additional properties to return via API
[docs]class User(UserInDBBase): pass
# Additional properties stored in DB
[docs]class UserInDB(UserInDBBase): hashed_password: str

Last update: Mar 10, 2024