Private
Public Access
1
0

improved UI on regattas

This commit is contained in:
Sander Roosendaal
2018-04-30 15:41:07 +02:00
parent 772bb41ecf
commit 5f1328ab73
6 changed files with 19 additions and 175 deletions

View File

@@ -1233,7 +1233,7 @@ 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)
weightcategory = models.CharField(default="hwt",max_length=10,choices=weightcategories)
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)
@@ -1478,10 +1478,10 @@ def auto_delete_image_on_delete(sender,instance, **kwargs):
# Form to update Workout data
class WorkoutForm(ModelForm):
duration = forms.TimeInput(format='%H:%M:%S.%f')
# duration = forms.TimeInput(format='%H:%M:%S.%f')
class Meta:
model = Workout
fields = ['name','date','starttime','timezone','duration','distance','workouttype','notes','privacy','rankingpiece','boattype']
fields = ['name','date','starttime','timezone','duration','distance','workouttype','weightcategory','notes','privacy','rankingpiece','boattype']
widgets = {
'date': AdminDateWidget(),
'notes': forms.Textarea,
@@ -1492,11 +1492,6 @@ class WorkoutForm(ModelForm):
super(WorkoutForm, self).__init__(*args, **kwargs)
# this line to be removed
del self.fields['privacy']
# self.fields['timezone'] = forms.ChoiceField(choices=[
# (x,x) for x in pytz.common_timezones
# ],
# initial='UTC',
# label='Time Zone')
if self.instance.workouttype != 'water':
del self.fields['boattype']
@@ -1509,6 +1504,7 @@ class WorkoutForm(ModelForm):
'duration',
'distance',
'workouttype',
'weightcategory',
'notes',
'rankingpiece',
'boattype'