forms & statements
This commit is contained in:
@@ -213,17 +213,17 @@ class CourseForm(forms.Form):
|
|||||||
super(CourseForm, self).__init__(*args, **kwargs)
|
super(CourseForm, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
# The form used for uploading files
|
# The form used for uploading files
|
||||||
#class StandardsForm(forms.Form):
|
class StandardsForm(forms.Form):
|
||||||
# name = forms.CharField(max_length=150,label='Course Name')
|
name = forms.CharField(max_length=150,label='Course Name')
|
||||||
# file = forms.FileField(required=False,
|
file = forms.FileField(required=False,
|
||||||
# validators=[must_be_csv])
|
validators=[must_be_csv])
|
||||||
# notes = forms.CharField(required=False,
|
notes = forms.CharField(required=False,
|
||||||
# max_length=200,label='Course Notes',
|
max_length=200,label='Course Notes',
|
||||||
# widget=forms.Textarea)
|
widget=forms.Textarea)
|
||||||
|
|
||||||
# def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
# from django.forms.widgets import HiddenInput
|
from django.forms.widgets import HiddenInput
|
||||||
# super(StandardsForm, self).__init__(*args, **kwargs)
|
super(StandardsForm, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
# The form used for uploading files
|
# The form used for uploading files
|
||||||
class DocumentsForm(forms.Form):
|
class DocumentsForm(forms.Form):
|
||||||
@@ -1230,11 +1230,11 @@ class RaceResultFilterForm(forms.Form):
|
|||||||
initial=['None','PR1','PR2','PR3','FES'],
|
initial=['None','PR1','PR2','PR3','FES'],
|
||||||
widget=forms.CheckboxSelectMultiple())
|
widget=forms.CheckboxSelectMultiple())
|
||||||
|
|
||||||
# entrycategory = forms.MultipleChoiceField(
|
entrycategory = forms.MultipleChoiceField(
|
||||||
# choices = [],
|
choices = [],
|
||||||
# label = 'Groups',
|
label = 'Groups',
|
||||||
# widget=forms.CheckboxSelectMultiple()
|
widget=forms.CheckboxSelectMultiple()
|
||||||
# )
|
)
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
if 'records' in kwargs:
|
if 'records' in kwargs:
|
||||||
@@ -1244,18 +1244,19 @@ class RaceResultFilterForm(forms.Form):
|
|||||||
|
|
||||||
if records:
|
if records:
|
||||||
# group
|
# group
|
||||||
# thecategories = [record.entrycategory for record in records]
|
thecategories = [record.entrycategory for record in records]
|
||||||
# thecategories = list(set(thecategories))
|
thecategories = list(set(thecategories))
|
||||||
# if len(thecategories) <= 1:
|
if len(thecategories) <= 1:
|
||||||
# del self.fields['entrycategory']
|
del self.fields['entrycategory']
|
||||||
# else:
|
else:
|
||||||
# categorychoices = []
|
categorychoices = []
|
||||||
# for category in thecategories:
|
for category in thecategories:
|
||||||
## categorychoices.append(
|
if category is not None:
|
||||||
# (category.id,category)
|
categorychoices.append(
|
||||||
# )
|
(category.id,category)
|
||||||
# self.fields['entrycategory'].choices = categorychoices
|
)
|
||||||
# self.fields['entrycategory'].initial = [cat[0] for cat in categorychoices]
|
self.fields['entrycategory'].choices = categorychoices
|
||||||
|
self.fields['entrycategory'].initial = [cat[0] for cat in categorychoices]
|
||||||
|
|
||||||
# sex
|
# sex
|
||||||
thesexes = [record.sex for record in records]
|
thesexes = [record.sex for record in records]
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ from rowers.forms import (
|
|||||||
EmailForm, RegistrationForm, RegistrationFormTermsOfService,
|
EmailForm, RegistrationForm, RegistrationFormTermsOfService,
|
||||||
RegistrationFormUniqueEmail,RegistrationFormSex,
|
RegistrationFormUniqueEmail,RegistrationFormSex,
|
||||||
CNsummaryForm,UpdateWindForm,
|
CNsummaryForm,UpdateWindForm,
|
||||||
# StandardsForm,
|
StandardsForm,
|
||||||
UpdateStreamForm,WorkoutMultipleCompareForm,ChartParamChoiceForm,
|
UpdateStreamForm,WorkoutMultipleCompareForm,ChartParamChoiceForm,
|
||||||
FusionMetricChoiceForm,BoxPlotChoiceForm,MultiFlexChoiceForm,
|
FusionMetricChoiceForm,BoxPlotChoiceForm,MultiFlexChoiceForm,
|
||||||
TrendFlexModalForm,WorkoutSplitForm,WorkoutJoinParamForm,
|
TrendFlexModalForm,WorkoutSplitForm,WorkoutJoinParamForm,
|
||||||
@@ -115,7 +115,7 @@ from rowers.models import (
|
|||||||
AlertEditForm, ConditionEditForm,
|
AlertEditForm, ConditionEditForm,
|
||||||
PlannedSessionComment,CoachRequest,CoachOffer,
|
PlannedSessionComment,CoachRequest,CoachOffer,
|
||||||
VideoAnalysis,ShareKey,
|
VideoAnalysis,ShareKey,
|
||||||
# StandardCollection,CourseStandard,
|
StandardCollection,CourseStandard,
|
||||||
)
|
)
|
||||||
from rowers.models import (
|
from rowers.models import (
|
||||||
RowerPowerForm,RowerForm,GraphImage,AdvancedWorkoutForm,
|
RowerPowerForm,RowerForm,GraphImage,AdvancedWorkoutForm,
|
||||||
|
|||||||
Reference in New Issue
Block a user