blob: d80919612ab91673714a84facedb5c7c022b1fa6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
from typing import Optional
from pydantic import BaseModel, EmailStr, Field
from app.schemas.profile import ProfileRead
from .integrations import UserIntegrationRead
class UserCreate(BaseModel):
username: str = Field(..., max_length=32)
email: EmailStr
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
has_password: bool
premium: bool
is_banned: bool
is_moderator: bool
profile: ProfileRead
integrations: Optional[UserIntegrationRead] = None
model_config = {
"from_attributes": True,
}
|