Private
Public Access
1
0

form test changes

This commit is contained in:
Sander Roosendaal
2019-01-22 12:18:27 +01:00
parent 43c2eb9b43
commit 17f41eb1bc
3 changed files with 29 additions and 2 deletions

View File

@@ -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

Binary file not shown.

View File

@@ -2502,7 +2502,7 @@
</Trackpoint>
</Track>
</Lap>
<Notes>&lt;Element 'Notes' at 0x13a97908&gt;</Notes>
<Notes>&lt;Element 'Notes' at 0x14de02b0&gt;</Notes>
</Activity>
</Activities>
<Creator>