adding Standard Times to events
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
# Generated by Django 2.1.7 on 2020-05-26 18:13
|
# Generated by Django 2.1.7 on 2020-05-26 18:20
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|||||||
@@ -2262,7 +2262,8 @@ class VirtualRace(PlannedSession):
|
|||||||
contact_email = models.EmailField(max_length=254,
|
contact_email = models.EmailField(max_length=254,
|
||||||
validators=[validate_email],blank=True)
|
validators=[validate_email],blank=True)
|
||||||
|
|
||||||
coursestandards = models.ForeignKey(StandardCollection,null=True,on_delete=models.SET_NULL)
|
coursestandards = models.ForeignKey(StandardCollection,null=True,on_delete=models.SET_NULL,
|
||||||
|
verbose_name='Standard Times')
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
||||||
@@ -2432,6 +2433,7 @@ class IndoorVirtualRaceForm(ModelForm):
|
|||||||
'registration_closure',
|
'registration_closure',
|
||||||
'evaluation_closure',
|
'evaluation_closure',
|
||||||
'comment',
|
'comment',
|
||||||
|
'coursestandards',
|
||||||
'contact_phone',
|
'contact_phone',
|
||||||
'contact_email',
|
'contact_email',
|
||||||
]
|
]
|
||||||
@@ -2568,6 +2570,7 @@ class VirtualRaceForm(ModelForm):
|
|||||||
'registration_closure',
|
'registration_closure',
|
||||||
'evaluation_closure',
|
'evaluation_closure',
|
||||||
'course',
|
'course',
|
||||||
|
'coursestandards',
|
||||||
'comment',
|
'comment',
|
||||||
'contact_phone',
|
'contact_phone',
|
||||||
'contact_email',
|
'contact_email',
|
||||||
@@ -2939,6 +2942,7 @@ class VirtualRaceResult(models.Model):
|
|||||||
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)
|
||||||
|
points = models.IntegerField(default=0)
|
||||||
boatclass = models.CharField(choices=boatclasses,
|
boatclass = models.CharField(choices=boatclasses,
|
||||||
max_length=40,
|
max_length=40,
|
||||||
default='water',
|
default='water',
|
||||||
@@ -3002,6 +3006,7 @@ class IndoorVirtualRaceResult(models.Model):
|
|||||||
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)
|
||||||
|
points = models.IntegerField(default=0)
|
||||||
boatclass = models.CharField(choices=boatclasses,
|
boatclass = models.CharField(choices=boatclasses,
|
||||||
max_length=40,
|
max_length=40,
|
||||||
default='rower',
|
default='rower',
|
||||||
|
|||||||
@@ -55,6 +55,15 @@
|
|||||||
If you require a screenshot of the PM monitor, do mention this
|
If you require a screenshot of the PM monitor, do mention this
|
||||||
in the comment.
|
in the comment.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
Standard Times are a way to compare results in a race category with
|
||||||
|
a course record or golden standard for that event. A point score is calculated
|
||||||
|
which compares the participant's result with the standard. This offers an
|
||||||
|
engaging way to compete on points across different categories, boat types, and skill
|
||||||
|
levels.
|
||||||
|
If you select a Standard Times set from the drop-down list, race categories will
|
||||||
|
be limited to those in the selected set of Standard Times.
|
||||||
|
</p>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -104,6 +104,11 @@
|
|||||||
<th>Challenge Time Zone</th><td>{{ race.timezone }}</td>
|
<th>Challenge Time Zone</th><td>{{ race.timezone }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if race.coursestandards %}
|
||||||
|
<tr>
|
||||||
|
<th>Standard Times</th><td><a href="/rowers/standards/{{ race.coursestandards.id }}/">{{ race.coursestandards }}</a></td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
{{ race.sessionmode }} challenge
|
{{ race.sessionmode }} challenge
|
||||||
@@ -541,6 +546,17 @@
|
|||||||
review and reject entries. If you are disqualified in this
|
review and reject entries. If you are disqualified in this
|
||||||
way, you will receive an email with the reason.
|
way, you will receive an email with the reason.
|
||||||
</p>
|
</p>
|
||||||
|
{% if race.coursestandards %}
|
||||||
|
<p>
|
||||||
|
Standard Times are a way to compare results in a race category with
|
||||||
|
a course record or golden standard for that event. A point score is calculated
|
||||||
|
which compares the participant's result with the standard. This offers an
|
||||||
|
engaging way to compete on points across different categories, boat types, and skill
|
||||||
|
levels.
|
||||||
|
If you select a Standard Times set from the drop-down list, race categories will
|
||||||
|
be limited to those in the selected set of Standard Times.
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -49,6 +49,15 @@
|
|||||||
is strongly recommended that you fill out a contact email or phone
|
is strongly recommended that you fill out a contact email or phone
|
||||||
number.
|
number.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
Standard Times are a way to compare results in a race category with
|
||||||
|
a course record or golden standard for that event. A point score is calculated
|
||||||
|
which compares the participant's result with the standard. This offers an
|
||||||
|
engaging way to compete on points across different categories, boat types, and skill
|
||||||
|
levels.
|
||||||
|
If you select a Standard Times set from the drop-down list, race categories will
|
||||||
|
be limited to those in the selected set of Standard Times.
|
||||||
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|||||||
@@ -529,6 +529,11 @@ def standards_upload_view(request,id=0):
|
|||||||
is_ajax = True
|
is_ajax = True
|
||||||
r = getrower(request.user)
|
r = getrower(request.user)
|
||||||
|
|
||||||
|
if id != 0:
|
||||||
|
collection = StandardCollection.objects.get(id=id)
|
||||||
|
if request.user != collection.manager:
|
||||||
|
raise PermissionDenied("You cannot change this set of time standards")
|
||||||
|
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
form = StandardsForm(request.POST,request.FILES)
|
form = StandardsForm(request.POST,request.FILES)
|
||||||
@@ -573,6 +578,12 @@ def standards_upload_view(request,id=0):
|
|||||||
else:
|
else:
|
||||||
if not is_ajax:
|
if not is_ajax:
|
||||||
form = StandardsForm()
|
form = StandardsForm()
|
||||||
|
if id != 0:
|
||||||
|
collection = StandardCollection.objects.get(id=id)
|
||||||
|
form = StandardsForm(initial={
|
||||||
|
'name':collection.name,
|
||||||
|
'notes': collection.notes,
|
||||||
|
})
|
||||||
return render(request,'standard_form.html',
|
return render(request,'standard_form.html',
|
||||||
{'form':form,
|
{'form':form,
|
||||||
'active':'nav-racing',
|
'active':'nav-racing',
|
||||||
@@ -655,7 +666,6 @@ def virtualevents_view(request):
|
|||||||
country__in=countries
|
country__in=countries
|
||||||
).order_by("startdate","start_time")
|
).order_by("startdate","start_time")
|
||||||
else:
|
else:
|
||||||
|
|
||||||
form = VirtualRaceSelectForm()
|
form = VirtualRaceSelectForm()
|
||||||
|
|
||||||
if is_ajax:
|
if is_ajax:
|
||||||
@@ -1938,6 +1948,7 @@ def indoorvirtualevent_create_view(request):
|
|||||||
evaluation_closure = cd['evaluation_closure']
|
evaluation_closure = cd['evaluation_closure']
|
||||||
contact_phone = cd['contact_phone']
|
contact_phone = cd['contact_phone']
|
||||||
contact_email = cd['contact_email']
|
contact_email = cd['contact_email']
|
||||||
|
coursestandards = cd['coursestandards']
|
||||||
|
|
||||||
# correct times
|
# correct times
|
||||||
|
|
||||||
@@ -1992,6 +2003,7 @@ def indoorvirtualevent_create_view(request):
|
|||||||
sessionvalue = sessionvalue,
|
sessionvalue = sessionvalue,
|
||||||
course=None,
|
course=None,
|
||||||
timezone=timezone_str,
|
timezone=timezone_str,
|
||||||
|
coursestandards=coursestandards,
|
||||||
evaluation_closure=evaluation_closure,
|
evaluation_closure=evaluation_closure,
|
||||||
registration_closure=registration_closure,
|
registration_closure=registration_closure,
|
||||||
contact_phone=contact_phone,
|
contact_phone=contact_phone,
|
||||||
@@ -2078,6 +2090,7 @@ def virtualevent_create_view(request):
|
|||||||
evaluation_closure = cd['evaluation_closure']
|
evaluation_closure = cd['evaluation_closure']
|
||||||
contact_phone = cd['contact_phone']
|
contact_phone = cd['contact_phone']
|
||||||
contact_email = cd['contact_email']
|
contact_email = cd['contact_email']
|
||||||
|
coursestandards = cd['coursestandards']
|
||||||
|
|
||||||
# correct times
|
# correct times
|
||||||
|
|
||||||
@@ -2129,6 +2142,7 @@ def virtualevent_create_view(request):
|
|||||||
evaluation_closure=evaluation_closure,
|
evaluation_closure=evaluation_closure,
|
||||||
registration_closure=registration_closure,
|
registration_closure=registration_closure,
|
||||||
contact_phone=contact_phone,
|
contact_phone=contact_phone,
|
||||||
|
coursestandards=coursestandards,
|
||||||
contact_email=contact_email,
|
contact_email=contact_email,
|
||||||
country = course.country,
|
country = course.country,
|
||||||
manager=request.user,
|
manager=request.user,
|
||||||
|
|||||||
Reference in New Issue
Block a user