36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
"""Exercise model for the exercise library catalog.
|
|
|
|
Each exercise belongs to a workout day and includes form cues.
|
|
"""
|
|
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from sqlmodel import Field, SQLModel
|
|
|
|
|
|
class Exercise(SQLModel, table=True):
|
|
"""An exercise in the workout library.
|
|
|
|
Attributes:
|
|
id: Primary key, auto-incremented.
|
|
name: Exercise name (e.g., "DB Chest Press (Floor)").
|
|
muscle_group: Target muscle group (e.g., "Chest", "Shoulders").
|
|
workout_day: Which day this exercise belongs to (Push/Pull/Lower/Full Body).
|
|
sets: Default number of sets.
|
|
tempo: Tempo notation (e.g., "3-1-2" = 3s eccentric, 1s pause, 2s concentric).
|
|
form_cues: Detailed form instructions.
|
|
created_at: Timestamp when the record was created.
|
|
"""
|
|
|
|
__tablename__ = "exercises"
|
|
|
|
id: Optional[int] = Field(default=None, primary_key=True)
|
|
name: str = Field(index=True)
|
|
muscle_group: str = Field(default="")
|
|
workout_day: str = Field(index=True)
|
|
sets: int = Field(default=3)
|
|
tempo: str = Field(default="")
|
|
form_cues: str = Field(default="")
|
|
created_at: datetime = Field(default_factory=datetime.utcnow)
|