diff --git a/rowers/models.py b/rowers/models.py index a096c2a5..737dd97b 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -1495,7 +1495,8 @@ class Workout(models.Model): plannedsession = models.ForeignKey(PlannedSession, blank=True,null=True) name = models.CharField(max_length=150) date = models.DateField() - workouttype = models.CharField(choices=workouttypes,max_length=50) + workouttype = models.CharField(choices=workouttypes,max_length=50, + verbose_name='Exercise/Boat Class') workoutsource = models.CharField(max_length=100, default='unknown') boattype = models.CharField(choices=boattypes,max_length=50, @@ -1508,7 +1509,11 @@ class Workout(models.Model): max_length=100) distance = models.IntegerField(default=0,blank=True) duration = models.TimeField(default=1,blank=True) - weightcategory = models.CharField(default="hwt",max_length=10,choices=weightcategories) + weightcategory = models.CharField( + default="hwt", + max_length=10, + choices=weightcategories, + verbose_name='Weight Category') weightvalue = models.FloatField(default=80.0,blank=True,verbose_name = 'Average Crew Weight (kg)') csvfilename = models.CharField(blank=True,max_length=150) uploadedtoc2 = models.IntegerField(default=0) @@ -1794,7 +1799,7 @@ class WorkoutForm(ModelForm): # duration = forms.TimeInput(format='%H:%M:%S.%f') class Meta: model = Workout - fields = ['name','date','starttime','timezone','duration','distance','workouttype','weightcategory','notes','privacy','rankingpiece','boattype'] + fields = ['name','date','starttime','timezone','duration','distance','workouttype','boattype','weightcategory','notes','privacy','rankingpiece'] widgets = { 'date': AdminDateWidget(), 'notes': forms.Textarea, @@ -1806,7 +1811,7 @@ class WorkoutForm(ModelForm): # this line to be removed del self.fields['privacy'] - if self.instance.workouttype != 'water': + if self.instance.workouttype not in types.otwtypes: del self.fields['boattype'] fieldorder = ( diff --git a/rowers/types.py b/rowers/types.py index 5d3ec0af..a1781393 100644 --- a/rowers/types.py +++ b/rowers/types.py @@ -1,5 +1,5 @@ workouttypes = ( - ('water','On-water - Olympic'), + ('water','Standard Racing Shell'), ('rower','Indoor Rower'), ('skierg','Ski Erg'), ('dynamic','Dynamic Indoor Rower'), diff --git a/rowers/views.py b/rowers/views.py index 0f36576f..cdcee2fb 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -9192,6 +9192,7 @@ def workout_edit_view(request,id=0,message="",successmessage=""): distance = form.cleaned_data['distance'] notes = form.cleaned_data['notes'] thetimezone = form.cleaned_data['timezone'] + try: boattype = request.POST['boattype'] except KeyError: