diff --git a/rowers/models.py b/rowers/models.py index e68eb995..76a535bd 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -1726,6 +1726,13 @@ class TrainingMicroCycleForm(ModelForm): 'enddate': AdminDateWidget() } +regularsessiontypechoices = ( + ('session','Training Session'), + ('challenge','Challenge'), + ('test','Mandatory Test'), + ('cycletarget','Total for a time period'), + ('coursetest','OTW test over a course'), +) # model for Planned Session (Workout, Challenge, Test) class PlannedSession(models.Model): @@ -1740,6 +1747,14 @@ class PlannedSession(models.Model): ('indoorrace','Indoor Virtual Race'), ) + regularsessiontypechoices = ( + ('session','Training Session'), + ('challenge','Challenge'), + ('test','Mandatory Test'), + ('cycletarget','Total for a time period'), + ('coursetest','OTW test over a course'), + ) + sessionmodechoices = ( ('distance','Distance'), ('time','Time'), @@ -2012,6 +2027,7 @@ class PlannedSessionForm(ModelForm): def __init__(self,*args,**kwargs): super(PlannedSessionForm, self).__init__(*args, **kwargs) self.fields['course'].queryset = GeoCourse.objects.all().order_by("country","name") + self.fields['sessiontype'].choices = regularsessiontypechoices def get_course_timezone(course): @@ -2293,6 +2309,13 @@ class VirtualRaceForm(ModelForm): return cd class PlannedSessionFormSmall(ModelForm): + regularsessiontypechoices = ( + ('session','Training Session'), + ('challenge','Challenge'), + ('test','Mandatory Test'), + ('cycletarget','Total for a time period'), + ('coursetest','OTW test over a course'), + ) class Meta: model = PlannedSession @@ -2321,7 +2344,11 @@ class PlannedSessionFormSmall(ModelForm): 'sessionvalue': forms.TextInput(attrs={'style':'width:5em', 'type':'number'}), 'manager': forms.HiddenInput(), - } + } + + def __init__(self,*args,**kwargs): + super(PlannedSessionFormSmall, self).__init__(*args, **kwargs) + self.fields['sessiontype'].choices = regularsessiontypechoices boattypes = mytypes.boattypes diff --git a/rowers/tests/testdata/testdata.csv.gz b/rowers/tests/testdata/testdata.csv.gz index 02b2c36e..a6576a4b 100644 Binary files a/rowers/tests/testdata/testdata.csv.gz and b/rowers/tests/testdata/testdata.csv.gz differ diff --git a/rowers/tests/testdata/testdata.tcx b/rowers/tests/testdata/testdata.tcx index 3072411a..47b39a67 100644 --- a/rowers/tests/testdata/testdata.tcx +++ b/rowers/tests/testdata/testdata.tcx @@ -2502,7 +2502,7 @@ - <Element 'Notes' at 0x13a97908> + <Element 'Notes' at 0x14de02b0>