Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /olaflaitinen_Promethium /src /promethium /api /schemas /user.py
| """ | |
| User schemas. | |
| """ | |
| from datetime import datetime | |
| from typing import Optional | |
| from pydantic import BaseModel, EmailStr, Field | |
| class UserBase(BaseModel): | |
| """Base user schema.""" | |
| email: EmailStr | |
| full_name: str = Field(..., min_length=1, max_length=255) | |
| role: str = Field(default="user", pattern="^(admin|user)$") | |
| is_active: bool = True | |
| class UserCreate(UserBase): | |
| """User creation schema.""" | |
| password: str = Field(..., min_length=8) | |
| class UserUpdate(BaseModel): | |
| """User update schema.""" | |
| email: Optional[EmailStr] = None | |
| full_name: Optional[str] = Field(None, min_length=1, max_length=255) | |
| password: Optional[str] = Field(None, min_length=8) | |
| is_active: Optional[bool] = None | |
| class UserRead(UserBase): | |
| """User response schema.""" | |
| id: int | |
| created_at: datetime | |
| updated_at: Optional[datetime] = None | |
| class Config: | |
| from_attributes = True | |
| class UserInDB(UserRead): | |
| """User in database schema (internal use).""" | |
| hashed_password: str | |
Xet Storage Details
- Size:
- 1.02 kB
- Xet hash:
- 9ba65fbcee50fe5ec584dcdd2beedfd1e6040a06b11c020978c03463034c70a7
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.