- Add rules_engine.py with quantitative rules for all 8 workout types - Add quality gate retry loop in generate_single_workout() - Expand calibrate_structure_rules to all 120 combinations (8 types × 5 goals × 3 sections) - Wire WeeklySplitPattern DB records into _pick_weekly_split() - Enforce movement patterns from WorkoutStructureRule in exercise selection - Add straight-set strength support (single main lift, 4-6 rounds) - Add modality consistency check for duration-dominant workout types - Add InjuryStep component to onboarding and preferences - Add sibling exercise exclusion in regenerate and preview_day endpoints - Display generator warnings on dashboard - Expand fix_rep_durations, fix_exercise_flags, fix_movement_pattern_typo - Add audit_exercise_data and check_rules_drift management commands - Add Next.js frontend with dashboard, onboarding, preferences, history pages - Add generator app with ML-powered workout generation pipeline - 96 new tests across 7 test modules Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
49 lines
1.7 KiB
Python
49 lines
1.7 KiB
Python
from django.db import models
|
|
from workout.models import Workout
|
|
from exercise.models import Exercise
|
|
|
|
# Create your models here.
|
|
class Superset(models.Model):
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
updated_at = models.DateTimeField(auto_now=True)
|
|
name = models.CharField(max_length=255, blank=True, null=True)
|
|
|
|
workout = models.ForeignKey(
|
|
Workout,
|
|
on_delete=models.CASCADE,
|
|
related_name='superset_workout'
|
|
)
|
|
|
|
rounds = models.IntegerField(max_length=3, blank=False, null=False)
|
|
order = models.IntegerField(max_length=3, blank=False, null=False)
|
|
estimated_time = models.FloatField(max_length=255, blank=True, null=True)
|
|
rest_between_rounds = models.IntegerField(default=45, help_text='Rest between rounds in seconds')
|
|
|
|
def __str__(self):
|
|
name = " -- " if self.name is None else self.name
|
|
return name #+ " : " + self.description + " | by: " + self.registered_user.nick_name
|
|
|
|
class SupersetExercise(models.Model):
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
updated_at = models.DateTimeField(auto_now=True)
|
|
|
|
exercise = models.ForeignKey(
|
|
Exercise,
|
|
on_delete=models.CASCADE,
|
|
related_name='exercise_supersets'
|
|
)
|
|
|
|
superset = models.ForeignKey(
|
|
Superset,
|
|
on_delete=models.CASCADE,
|
|
related_name='superset_exercises'
|
|
)
|
|
|
|
weight = models.IntegerField(null=True, blank=True, max_length=4)
|
|
reps = models.IntegerField(null=True, blank=True, max_length=4)
|
|
duration = models.IntegerField(null=True, blank=True, max_length=4)
|
|
order = models.IntegerField(max_length=3, blank=False, null=False)
|
|
|
|
def __str__(self):
|
|
return self.superset.workout.name + " -- " + self.exercise.name
|