Problem description:

Suppose there is an ExercisePlan record (set=3, reps=12), which means
that this exercise should be done with 3 sets and the trainer suggests
to repeat the exercise about 12 times in each set.  Here is the
ExercisePlan table data in db:

id  |  sets  |   reps
-----------------------
1        3           12

Trainee needs to report the result via ExerciseReport class. Here is
the ExerciseReport table data in db:

id  |  exercisePlan_id  |  setIndex  |   reps
---------------------------------------------------
1               1                      1               15
1               1                      2               12
1               1                      3               8

which means that the trainee repeated exercise 15 times in the first
set, 12 times in second set and 8 times in third set.

My question:
How to generate a form to allow user to report their results for
multiple ExercisePlan?

DB Table definition example:

class ExercisePlan(models.Model):
    sets = models.IntegerField()
    reps = models.IntegerField()

class ExerciseReport(models.Model):
    exercisePlan = models.ForeignKey(ExercisePlan)
    setIndex = models.IntegerField()
    reps = models.IntegerField()

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to