Spaces:
Running on T4
Running on T4
Download backend/app/modules/drills/models.py from modventures/baseball-engine: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/backend/app/modules/drills/models.py
- Command line
-
hf download hf://spaces/modventures/baseball-engine/backend/app/modules/drills/models.py
-
curl -L -o models.py https://huggingface.co/spaces/modventures/baseball-engine/resolve/main/backend/app/modules/drills/models.py
1.18 kB
| import uuid | |
| from datetime import date | |
| from sqlalchemy import CheckConstraint, Date, ForeignKey, Index, SmallInteger, String | |
| from sqlalchemy.dialects.postgresql import UUID | |
| from sqlalchemy.orm import Mapped, mapped_column | |
| from app.common.base_model import Base, CreatedAtMixin, IdMixin | |
| class DrillLog(IdMixin, CreatedAtMixin, Base): | |
| """One logged set. day is the device's local date so "sets today" matches what the player sees.""" | |
| __tablename__ = "drill_logs" | |
| __table_args__ = ( | |
| CheckConstraint("reps BETWEEN 1 AND 8", name="reps"), | |
| Index("ix_drill_logs_owner_id_day", "owner_id", "day"), | |
| ) | |
| owner_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("accounts.id", ondelete="CASCADE")) | |
| session_id: Mapped[uuid.UUID | None] = mapped_column( | |
| UUID(as_uuid=True), ForeignKey("sessions.id", ondelete="SET NULL") | |
| ) | |
| drill_id: Mapped[str] = mapped_column(String(40)) | |
| assignment_id: Mapped[uuid.UUID | None] = mapped_column( | |
| UUID(as_uuid=True), ForeignKey("drill_assignments.id", ondelete="SET NULL") | |
| ) | |
| reps: Mapped[int] = mapped_column(SmallInteger) | |
| day: Mapped[date] = mapped_column(Date) | |