Private
Public Access
1
0

first version of virtualsessions_view - not working

This commit is contained in:
Sander Roosendaal
2018-04-12 17:05:37 +02:00
parent 97cce15d68
commit be1f17fde3
7 changed files with 72 additions and 5 deletions

View File

@@ -716,5 +716,22 @@ class PlannedSessionTeamMemberForm(forms.Form):
super(PlannedSessionTeamMemberForm,self).__init__(*args,**kwargs)
self.fields['members'].queryset = thesession.rower.all()
from rowers.models import VirtualRace,GeoCourse
def get_countries():
countries = VirtualRace.objects.order_by('country').values_list('country').distinct()
# countries = GeoCourse.objects.order_by('country').values_list('country').distinct()
return countries
class VirtualRaceSelectForm(forms.Form):
country = forms.ChoiceField(
label='Country',
choices = get_countries()
)
def __init__(self, *args, **kwargs):
super(VirtualRaceSelectForm, self).__init__(*args, **kwargs)
self.fields['country'] = forms.ChoiceField(
choices = get_countries(),
)