Private
Public Access
1
0

returning stanadrds

This commit is contained in:
Sander Roosendaal
2020-05-28 13:41:17 +02:00
parent c3fac1f11c
commit 0dfd5226a0
3 changed files with 56 additions and 56 deletions

View File

@@ -12,7 +12,7 @@ from .models import (
WorkoutComment,C2WorldClassAgePerformance,PlannedSession, WorkoutComment,C2WorldClassAgePerformance,PlannedSession,
GeoCourse,GeoPolygon,GeoPoint,VirtualRace,VirtualRaceResult, GeoCourse,GeoPolygon,GeoPoint,VirtualRace,VirtualRaceResult,
PaidPlan,IndoorVirtualRaceResult,ShareKey, PaidPlan,IndoorVirtualRaceResult,ShareKey,
#CourseStandard,StandardCollection, CourseStandard,StandardCollection,
) )
# Register your models here so you can use them in the Admin module # Register your models here so you can use them in the Admin module
@@ -167,5 +167,5 @@ admin.site.register(VirtualRaceResult, VirtualRaceResultAdmin)
admin.site.register(IndoorVirtualRaceResult, IndoorVirtualRaceResultAdmin) admin.site.register(IndoorVirtualRaceResult, IndoorVirtualRaceResultAdmin)
admin.site.register(PaidPlan,PaidPlanAdmin) admin.site.register(PaidPlan,PaidPlanAdmin)
admin.site.register(ShareKey,ShareKeyAdmin) admin.site.register(ShareKey,ShareKeyAdmin)
#admin.site.register(CourseStandard,CourseStandardAdmin) admin.site.register(CourseStandard,CourseStandardAdmin)
#admin.site.register(StandardCollection,StandardCollectionAdmin) admin.site.register(StandardCollection,StandardCollectionAdmin)

View File

@@ -2183,38 +2183,38 @@ class PlannedSession(models.Model):
from django.core.validators import RegexValidator,validate_email from django.core.validators import RegexValidator,validate_email
#class StandardCollection(models.Model): class StandardCollection(models.Model):
# name = models.CharField(max_length=150) name = models.CharField(max_length=150)
# manager = models.ForeignKey(User, null=True,on_delete=models.CASCADE) manager = models.ForeignKey(User, null=True,on_delete=models.CASCADE)
# notes = models.CharField(blank=True,null=True,max_length=1000) notes = models.CharField(blank=True,null=True,max_length=1000)
# active = models.BooleanField(default=True) active = models.BooleanField(default=True)
# def __str__(self): def __str__(self):
# return self.name return self.name
#class CourseStandard(models.Model): class CourseStandard(models.Model):
# name = models.CharField(max_length=150) name = models.CharField(max_length=150)
# coursedistance = models.IntegerField() coursedistance = models.IntegerField()
# coursetime = models.CharField(max_length=100,default="") coursetime = models.CharField(max_length=100,default="")
# referencespeed = models.FloatField() # average boat speed referencespeed = models.FloatField() # average boat speed
# agemin = models.IntegerField(default=0) agemin = models.IntegerField(default=0)
# agemax = models.IntegerField(default=120) agemax = models.IntegerField(default=120)
# boatclass = models.CharField(max_length=150) # corresponds to workout workouttype boatclass = models.CharField(max_length=150) # corresponds to workout workouttype
# boattype = models.CharField(choices=mytypes.boattypes,max_length=50,default='1x') boattype = models.CharField(choices=mytypes.boattypes,max_length=50,default='1x')
# sex = models.CharField(max_length=150) sex = models.CharField(max_length=150)
# weightclass = models.CharField(max_length=150) weightclass = models.CharField(max_length=150)
# adaptiveclass = models.CharField(choices=mytypes.adaptivetypes,max_length=50,default="None") adaptiveclass = models.CharField(choices=mytypes.adaptivetypes,max_length=50,default="None")
# skillclass = models.CharField(max_length=150) skillclass = models.CharField(max_length=150)
# standardcollection = models.ForeignKey(StandardCollection,on_delete=models.CASCADE) standardcollection = models.ForeignKey(StandardCollection,on_delete=models.CASCADE)
# class Meta: class Meta:
# unique_together = ( unique_together = (
# ('name','standardcollection') ('name','standardcollection')
# ) )
# def __str__(self): def __str__(self):
# return self.name return self.name
registerchoices = ( registerchoices = (
('windowstart','Start of challenge Window'), ('windowstart','Start of challenge Window'),
@@ -2253,8 +2253,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',blank=True) verbose_name='Standard Times',blank=True)
def __str__(self): def __str__(self):
@@ -2424,7 +2424,7 @@ class IndoorVirtualRaceForm(ModelForm):
'registration_closure', 'registration_closure',
'evaluation_closure', 'evaluation_closure',
'comment', 'comment',
#'coursestandards', 'coursestandards',
'contact_phone', 'contact_phone',
'contact_email', 'contact_email',
] ]
@@ -2458,7 +2458,7 @@ class IndoorVirtualRaceForm(ModelForm):
self.fields['sessionunit'].initial = 'm' self.fields['sessionunit'].initial = 'm'
if timezone: if timezone:
self.fields['timezone'].initial = timezone self.fields['timezone'].initial = timezone
#self.fields['coursestandards'].queryset = StandardCollection.objects.filter(active=True) self.fields['coursestandards'].queryset = StandardCollection.objects.filter(active=True)
def clean(self): def clean(self):
cd = self.cleaned_data cd = self.cleaned_data
@@ -2562,7 +2562,7 @@ class VirtualRaceForm(ModelForm):
'registration_closure', 'registration_closure',
'evaluation_closure', 'evaluation_closure',
'course', 'course',
#'coursestandards', 'coursestandards',
'comment', 'comment',
'contact_phone', 'contact_phone',
'contact_email', 'contact_email',
@@ -2586,7 +2586,7 @@ class VirtualRaceForm(ModelForm):
def __init__(self,*args,**kwargs): def __init__(self,*args,**kwargs):
super(VirtualRaceForm, self).__init__(*args, **kwargs) super(VirtualRaceForm, self).__init__(*args, **kwargs)
self.fields['course'].queryset = GeoCourse.objects.all().order_by("country","name") self.fields['course'].queryset = GeoCourse.objects.all().order_by("country","name")
#self.fields['coursestandards'].queryset = StandardCollection.objects.filter(active=True) self.fields['coursestandards'].queryset = StandardCollection.objects.filter(active=True)
def clean(self): def clean(self):
@@ -2959,8 +2959,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)
referencespeed = models.FloatField(default=5.0) referencespeed = models.FloatField(default=5.0)
#entrycategory = models.ForeignKey(CourseStandard,null=True,on_delete=models.SET_NULL, entrycategory = models.ForeignKey(CourseStandard,null=True,on_delete=models.SET_NULL,
# verbose_name='Group') verbose_name='Group')
def __str__(self): def __str__(self):
rr = Rower.objects.get(id=self.userid) rr = Rower.objects.get(id=self.userid)
@@ -2969,13 +2969,13 @@ class VirtualRaceResult(models.Model):
u2 = rr.user.last_name, u2 = rr.user.last_name,
) )
if self.teamname: if self.teamname:
# if self.entrycategory: if self.entrycategory:
# return u'Entry for {n} for "{r}" in {g} with {t}'.format( return u'Entry for {n} for "{r}" in {g} with {t}'.format(
# n = name, n = name,
# r = self.race, r = self.race,
# g = self.entrycategory, g = self.entrycategory,
# t = self.teamname, t = self.teamname,
# ) )
return u'Entry for {n} for "{r}" in {c} {d} with {t} ({s})'.format( return u'Entry for {n} for "{r}" in {c} {d} with {t} ({s})'.format(
n = name, n = name,
@@ -3035,8 +3035,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, entrycategory = models.ForeignKey(CourseStandard,null=True,on_delete=models.SET_NULL,
# verbose_name='Group') verbose_name='Group')
def __str__(self): def __str__(self):
rr = Rower.objects.get(id=self.userid) rr = Rower.objects.get(id=self.userid)
@@ -3045,13 +3045,13 @@ class IndoorVirtualRaceResult(models.Model):
u2 = rr.user.last_name, u2 = rr.user.last_name,
) )
if self.teamname: if self.teamname:
# if self.entrycategory: if self.entrycategory:
# return u'Entry for {n} for "{r}" in {g} with {t}'.format( return u'Entry for {n} for "{r}" in {g} with {t}'.format(
# n = name, n = name,
# r = self.race, r = self.race,
# g = self.entrycategory, g = self.entrycategory,
# t = self.teamname, t = self.teamname,
# ) )
return u'Entry for {n} for "{r}" on {c} with {t} ({s})'.format( return u'Entry for {n} for "{r}" on {c} with {t} ({s})'.format(
n = name, n = name,
r = self.race, r = self.race,

View File

@@ -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,