diff --git a/rowers/forms.py b/rowers/forms.py index b625c8a2..014bb968 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -213,17 +213,17 @@ class CourseForm(forms.Form): super(CourseForm, self).__init__(*args, **kwargs) # The form used for uploading files -#class StandardsForm(forms.Form): -# name = forms.CharField(max_length=150,label='Course Name') -# file = forms.FileField(required=False, -# validators=[must_be_csv]) -# notes = forms.CharField(required=False, -# max_length=200,label='Course Notes', -# widget=forms.Textarea) +class StandardsForm(forms.Form): + name = forms.CharField(max_length=150,label='Course Name') + file = forms.FileField(required=False, + validators=[must_be_csv]) + notes = forms.CharField(required=False, + max_length=200,label='Course Notes', + widget=forms.Textarea) -# def __init__(self, *args, **kwargs): -# from django.forms.widgets import HiddenInput -# super(StandardsForm, self).__init__(*args, **kwargs) + def __init__(self, *args, **kwargs): + from django.forms.widgets import HiddenInput + super(StandardsForm, self).__init__(*args, **kwargs) # The form used for uploading files class DocumentsForm(forms.Form): @@ -1230,11 +1230,11 @@ class RaceResultFilterForm(forms.Form): initial=['None','PR1','PR2','PR3','FES'], widget=forms.CheckboxSelectMultiple()) -# entrycategory = forms.MultipleChoiceField( -# choices = [], -# label = 'Groups', -# widget=forms.CheckboxSelectMultiple() -# ) + entrycategory = forms.MultipleChoiceField( + choices = [], + label = 'Groups', + widget=forms.CheckboxSelectMultiple() + ) def __init__(self, *args, **kwargs): if 'records' in kwargs: @@ -1244,18 +1244,19 @@ class RaceResultFilterForm(forms.Form): if records: # group -# thecategories = [record.entrycategory for record in records] -# thecategories = list(set(thecategories)) -# if len(thecategories) <= 1: -# del self.fields['entrycategory'] -# else: -# categorychoices = [] -# for category in thecategories: -## categorychoices.append( -# (category.id,category) -# ) -# self.fields['entrycategory'].choices = categorychoices -# self.fields['entrycategory'].initial = [cat[0] for cat in categorychoices] + thecategories = [record.entrycategory for record in records] + thecategories = list(set(thecategories)) + if len(thecategories) <= 1: + del self.fields['entrycategory'] + else: + categorychoices = [] + for category in thecategories: + if category is not None: + categorychoices.append( + (category.id,category) + ) + self.fields['entrycategory'].choices = categorychoices + self.fields['entrycategory'].initial = [cat[0] for cat in categorychoices] # sex thesexes = [record.sex for record in records] diff --git a/rowers/templates/virtualevent.html b/rowers/templates/virtualevent.html index a17279c0..3e2297ce 100644 --- a/rowers/templates/virtualevent.html +++ b/rowers/templates/virtualevent.html @@ -104,13 +104,11 @@
Standard Times are a way to compare results in a race category with @@ -597,7 +580,6 @@ be limited to those in the selected set of Standard Times.
{% endif %} - {% endcomment %} diff --git a/rowers/views/statements.py b/rowers/views/statements.py index ef600883..2a931d32 100644 --- a/rowers/views/statements.py +++ b/rowers/views/statements.py @@ -94,7 +94,7 @@ from rowers.forms import ( EmailForm, RegistrationForm, RegistrationFormTermsOfService, RegistrationFormUniqueEmail,RegistrationFormSex, CNsummaryForm,UpdateWindForm, -# StandardsForm, + StandardsForm, UpdateStreamForm,WorkoutMultipleCompareForm,ChartParamChoiceForm, FusionMetricChoiceForm,BoxPlotChoiceForm,MultiFlexChoiceForm, TrendFlexModalForm,WorkoutSplitForm,WorkoutJoinParamForm, @@ -115,7 +115,7 @@ from rowers.models import ( AlertEditForm, ConditionEditForm, PlannedSessionComment,CoachRequest,CoachOffer, VideoAnalysis,ShareKey, -# StandardCollection,CourseStandard, + StandardCollection,CourseStandard, ) from rowers.models import ( RowerPowerForm,RowerForm,GraphImage,AdvancedWorkoutForm,