diff options
| author | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2026-03-17 14:11:45 +0200 |
|---|---|---|
| committer | l3wdfut4pwr <l3wdfut4pwr@gmail.com> | 2026-03-17 14:11:45 +0200 |
| commit | 47fd81a5910eab3483f79d03eedf9307bc81252f (patch) | |
| tree | 3e1ebd1bddcea649eb968e65161555afd4c2898c /app/schemas/user.py | |
| parent | f01cb6703710b7df4c7c022047cd35e1d5e9c70e (diff) | |
simple registration prototype
Diffstat (limited to 'app/schemas/user.py')
| -rw-r--r-- | app/schemas/user.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/schemas/user.py b/app/schemas/user.py new file mode 100644 index 0000000..7151d54 --- /dev/null +++ b/app/schemas/user.py @@ -0,0 +1,29 @@ +from typing import Optional + +from pydantic import BaseModel, EmailStr, Field + + +class UserCreate(BaseModel): + username: str = Field(..., max_length=32) + email: Optional[EmailStr] = None + password: str = Field(..., min_length=8) + + model_config = { + "extra": "forbid", + } + + +class UserRead(BaseModel): + id: int + username: str + email: Optional[EmailStr] = None + google_id: Optional[str] = None + avatar_file: Optional[str] = None + banner_file: Optional[str] = None + premium: bool + is_banned: bool + is_moderator: bool + + model_config = { + "from_attributes": True, + } |
