adding template edit functionality
This commit is contained in:
@@ -2342,6 +2342,35 @@ class PlannedSessionForm(ModelForm):
|
||||
self.fields['sessiontype'].choices = regularsessiontypechoices
|
||||
|
||||
|
||||
class PlannedSessionTemplateForm(ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = PlannedSession
|
||||
fields = [
|
||||
'name',
|
||||
'sessiontype',
|
||||
'sessionmode',
|
||||
'criterium',
|
||||
'sessionvalue',
|
||||
'sessionunit',
|
||||
'course',
|
||||
'comment',
|
||||
]
|
||||
|
||||
dateTimeOptions = {
|
||||
'format': 'yyyy-mm-dd',
|
||||
'autoclose': True,
|
||||
}
|
||||
|
||||
widgets = {
|
||||
'comment': forms.Textarea,
|
||||
}
|
||||
|
||||
def __init__(self,*args,**kwargs):
|
||||
super(PlannedSessionTemplateForm, 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):
|
||||
polygons = GeoPolygon.objects.filter(course = course)
|
||||
points = GeoPoint.objects.filter(polygon = polygons[0])
|
||||
|
||||
Reference in New Issue
Block a user