registration form (not processing yet)
This commit is contained in:
@@ -2939,6 +2939,8 @@ class VirtualRaceResult(models.Model):
|
|||||||
adaptiveclass = models.CharField(default="None",max_length=50,
|
adaptiveclass = models.CharField(default="None",max_length=50,
|
||||||
choices=mytypes.adaptivetypes,
|
choices=mytypes.adaptivetypes,
|
||||||
verbose_name="Adaptive Class")
|
verbose_name="Adaptive Class")
|
||||||
|
skillclass = models.CharField(default="Open",max_length=50,
|
||||||
|
verbose_name="Skill Class")
|
||||||
race = models.ForeignKey(VirtualRace,on_delete=models.CASCADE)
|
race = models.ForeignKey(VirtualRace,on_delete=models.CASCADE)
|
||||||
duration = models.TimeField(default=datetime.time(1,0))
|
duration = models.TimeField(default=datetime.time(1,0))
|
||||||
distance = models.IntegerField(default=0)
|
distance = models.IntegerField(default=0)
|
||||||
@@ -2963,6 +2965,8 @@ class VirtualRaceResult(models.Model):
|
|||||||
|
|
||||||
startsecond = models.FloatField(default=0)
|
startsecond = models.FloatField(default=0)
|
||||||
endsecond = models.FloatField(default=0)
|
endsecond = models.FloatField(default=0)
|
||||||
|
entrycategory = models.ForeignKey(CourseStandard,null=True,on_delete=models.SET_NULL,
|
||||||
|
verbose_name='Field')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
rr = Rower.objects.get(id=self.userid)
|
rr = Rower.objects.get(id=self.userid)
|
||||||
@@ -3003,6 +3007,8 @@ class IndoorVirtualRaceResult(models.Model):
|
|||||||
adaptiveclass = models.CharField(default="None",max_length=50,
|
adaptiveclass = models.CharField(default="None",max_length=50,
|
||||||
choices=mytypes.adaptivetypes,
|
choices=mytypes.adaptivetypes,
|
||||||
verbose_name="Adaptive Class")
|
verbose_name="Adaptive Class")
|
||||||
|
skillclass = models.CharField(default="Open",max_length=50,
|
||||||
|
verbose_name="Skill Class")
|
||||||
race = models.ForeignKey(VirtualRace,on_delete=models.CASCADE)
|
race = models.ForeignKey(VirtualRace,on_delete=models.CASCADE)
|
||||||
duration = models.TimeField(default=datetime.time(1,0))
|
duration = models.TimeField(default=datetime.time(1,0))
|
||||||
distance = models.IntegerField(default=0)
|
distance = models.IntegerField(default=0)
|
||||||
@@ -3020,6 +3026,8 @@ class IndoorVirtualRaceResult(models.Model):
|
|||||||
age = models.IntegerField(null=True)
|
age = models.IntegerField(null=True)
|
||||||
emailnotifications = models.BooleanField(default=True,
|
emailnotifications = models.BooleanField(default=True,
|
||||||
verbose_name = 'Receive challenge notifications by email')
|
verbose_name = 'Receive challenge notifications by email')
|
||||||
|
entrycategory = models.ForeignKey(CourseStandard,null=True,on_delete=models.SET_NULL,
|
||||||
|
verbose_name='Category')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
rr = Rower.objects.get(id=self.userid)
|
rr = Rower.objects.get(id=self.userid)
|
||||||
@@ -3055,22 +3063,29 @@ class CourseTestResult(models.Model):
|
|||||||
class IndoorVirtualRaceResultForm(ModelForm):
|
class IndoorVirtualRaceResultForm(ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = IndoorVirtualRaceResult
|
model = IndoorVirtualRaceResult
|
||||||
fields = ['teamname','weightcategory','boatclass','age','adaptiveclass']
|
fields = ['teamname','weightcategory','boatclass','age','adaptiveclass',
|
||||||
|
'entrycategory']
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
categories = kwargs.pop('categories')
|
||||||
super(IndoorVirtualRaceResultForm, self).__init__(*args, **kwargs)
|
super(IndoorVirtualRaceResultForm, self).__init__(*args, **kwargs)
|
||||||
|
if categories is not None:
|
||||||
|
self.fields['entrycategory'].queryset = categories
|
||||||
|
self.fields['entrycategory'].empty_label = None
|
||||||
|
else:
|
||||||
|
self.fields.pop('entrycategory')
|
||||||
|
|
||||||
class VirtualRaceResultForm(ModelForm):
|
class VirtualRaceResultForm(ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = VirtualRaceResult
|
model = VirtualRaceResult
|
||||||
fields = ['teamname','weightcategory','boatclass','boattype',
|
fields = ['teamname','weightcategory','boatclass','boattype',
|
||||||
'age','adaptiveclass']
|
'age','adaptiveclass','entrycategory']
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
boattypes = kwargs.pop('boattypes',None)
|
boattypes = kwargs.pop('boattypes',None)
|
||||||
|
categories = kwargs.pop('categories',None)
|
||||||
super(VirtualRaceResultForm, self).__init__(*args, **kwargs)
|
super(VirtualRaceResultForm, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
if boattypes:
|
if boattypes:
|
||||||
@@ -3080,6 +3095,12 @@ class VirtualRaceResultForm(ModelForm):
|
|||||||
required=False,
|
required=False,
|
||||||
label='Mixed Gender')
|
label='Mixed Gender')
|
||||||
|
|
||||||
|
if categories is not None:
|
||||||
|
self.fields['entrycategory'].queryset = categories
|
||||||
|
self.fields['entrycategory'].empty_label = None
|
||||||
|
else:
|
||||||
|
self.fields.pop('entrycategory')
|
||||||
|
|
||||||
from rowers.metrics import rowingmetrics
|
from rowers.metrics import rowingmetrics
|
||||||
|
|
||||||
strokedatafields = {
|
strokedatafields = {
|
||||||
|
|||||||
@@ -35,6 +35,13 @@
|
|||||||
as a Male crew. Check the "Mixed gender" check box to register as a
|
as a Male crew. Check the "Mixed gender" check box to register as a
|
||||||
mixed gender crew (except for 1x where this check box does nothing).
|
mixed gender crew (except for 1x where this check box does nothing).
|
||||||
</p>
|
</p>
|
||||||
|
{% if race.coursestandards %}
|
||||||
|
<p>This race uses standard times and limits the race fields to those where
|
||||||
|
standard times exist. The "Field" form choice will overrule other selections you
|
||||||
|
make in the form (boat type, weight, etc) and your entry will be rejected
|
||||||
|
if the age and gender doesn't match.
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
<div class="grid_6 alpha">
|
<div class="grid_6 alpha">
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
{{ form.as_table }}
|
{{ form.as_table }}
|
||||||
|
|||||||
@@ -1529,7 +1529,13 @@ def virtualevent_addboat_view(request,id=0):
|
|||||||
'adaptiveclass': r.adaptiveclass,
|
'adaptiveclass': r.adaptiveclass,
|
||||||
}
|
}
|
||||||
|
|
||||||
form = VirtualRaceResultForm(initial=initial)
|
categories = None
|
||||||
|
if race.coursestandards is not None:
|
||||||
|
categories = CourseStandard.objects.filter(
|
||||||
|
standardcollection=race.coursestandards).order_by("name")
|
||||||
|
|
||||||
|
|
||||||
|
form = VirtualRaceResultForm(initial=initial,categories=categories)
|
||||||
|
|
||||||
breadcrumbs = [
|
breadcrumbs = [
|
||||||
{
|
{
|
||||||
@@ -1684,7 +1690,12 @@ def virtualevent_register_view(request,id=0):
|
|||||||
'adaptiveclass': r.adaptiveclass,
|
'adaptiveclass': r.adaptiveclass,
|
||||||
}
|
}
|
||||||
|
|
||||||
form = VirtualRaceResultForm(initial=initial)
|
categories = None
|
||||||
|
if race.coursestandards is not None:
|
||||||
|
categories = CourseStandard.objects.filter(
|
||||||
|
standardcollection=race.coursestandards).order_by("name")
|
||||||
|
|
||||||
|
form = VirtualRaceResultForm(initial=initial,categories=categories)
|
||||||
|
|
||||||
breadcrumbs = [
|
breadcrumbs = [
|
||||||
{
|
{
|
||||||
@@ -1875,7 +1886,12 @@ def indoorvirtualevent_register_view(request,id=0):
|
|||||||
'adaptiveclass': r.adaptiveclass,
|
'adaptiveclass': r.adaptiveclass,
|
||||||
}
|
}
|
||||||
|
|
||||||
form = IndoorVirtualRaceResultForm(initial=initial)
|
categories = None
|
||||||
|
if race.coursestandards is not None:
|
||||||
|
categories = CourseStandard.objects.filter(
|
||||||
|
standardcollection=race.coursestandards).order_by("name")
|
||||||
|
|
||||||
|
form = IndoorVirtualRaceResultForm(initial=initial,categories=categories)
|
||||||
|
|
||||||
breadcrumbs = [
|
breadcrumbs = [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user