Initial project scaffold
Full-stack homeschool web app with FastAPI backend, Vue 3 frontend, MySQL database, and Docker Compose orchestration. Includes JWT auth, WebSocket real-time TV dashboard, schedule builder, activity logging, and multi-child support. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
23
backend/app/models/child.py
Normal file
23
backend/app/models/child.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from datetime import date
|
||||
from sqlalchemy import String, Boolean, ForeignKey, Date
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
from app.models.base import Base, TimestampMixin
|
||||
|
||||
|
||||
class Child(TimestampMixin, Base):
|
||||
__tablename__ = "children"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
|
||||
user_id: Mapped[int] = mapped_column(ForeignKey("users.id", ondelete="CASCADE"), nullable=False)
|
||||
name: Mapped[str] = mapped_column(String(100), nullable=False)
|
||||
birth_date: Mapped[date | None] = mapped_column(Date, nullable=True)
|
||||
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
||||
color: Mapped[str] = mapped_column(String(7), default="#4F46E5") # hex color for UI
|
||||
|
||||
user: Mapped["User"] = relationship("User", back_populates="children") # noqa: F821
|
||||
daily_sessions: Mapped[list["DailySession"]] = relationship( # noqa: F821
|
||||
"DailySession", back_populates="child"
|
||||
)
|
||||
activity_logs: Mapped[list["ActivityLog"]] = relationship( # noqa: F821
|
||||
"ActivityLog", back_populates="child"
|
||||
)
|
||||
Reference in New Issue
Block a user