Subject options: - New subject_options table (auto-created on startup) - SubjectOut now includes options list; all eager-loading chains updated - Admin: Options panel per subject with add, inline edit, and delete - WS broadcast and dashboard API include options in block subject data TV dashboard: - Three equal columns: Timer | Activities | Schedule - Activities column shows current subject's options in large readable text - Activities area has subject-colored border and tinted background - Subject name and label displayed correctly using embedded subject data Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
43 lines
752 B
Python
43 lines
752 B
Python
from pydantic import BaseModel
|
|
|
|
|
|
class SubjectOptionCreate(BaseModel):
|
|
text: str
|
|
order_index: int = 0
|
|
|
|
|
|
class SubjectOptionUpdate(BaseModel):
|
|
text: str | None = None
|
|
|
|
|
|
class SubjectOptionOut(BaseModel):
|
|
id: int
|
|
text: str
|
|
order_index: int
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class SubjectCreate(BaseModel):
|
|
name: str
|
|
color: str = "#10B981"
|
|
icon: str = "📚"
|
|
|
|
|
|
class SubjectUpdate(BaseModel):
|
|
name: str | None = None
|
|
color: str | None = None
|
|
icon: str | None = None
|
|
is_active: bool | None = None
|
|
|
|
|
|
class SubjectOut(BaseModel):
|
|
id: int
|
|
name: str
|
|
color: str
|
|
icon: str
|
|
is_active: bool
|
|
options: list[SubjectOptionOut] = []
|
|
|
|
model_config = {"from_attributes": True}
|