Private
Public Access
1
0

added coursestandards to virtualrace

This commit is contained in:
Sander Roosendaal
2020-05-25 21:58:00 +02:00
parent e4e5397e40
commit 74ff1f9874

View File

@@ -2194,7 +2194,22 @@ class PlannedSession(models.Model):
from django.core.validators import RegexValidator,validate_email
class StandardCollection(models.Model):
name = models.CharField(max_length=150)
class CourseStandard(models.Model):
name = models.CharField(max_length=150)
coursedistance = models.IntegerField()
coursestandard = models.FloatField() # average boat speed
agemin = models.IntegerField(default=0)
agemax = models.IntegerField(default=120)
boatclass = models.CharField(max_length=150) # corresponds to workout workouttype
boattype = models.CharField(choices=mytypes.boattypes,max_length=50,default='1x')
sex = models.CharField(max_length=150)
weightclass = models.CharField(max_length=150)
adaptiveclass = models.CharField(choices=mytypes.adaptivetypes,max_length=50,default="None")
skillclass = models.CharField(max_length=150)
standardcollection = models.ForeignKey(StandardCollection,on_delete=models.CASCADE)
registerchoices = (
('windowstart','Start of challenge Window'),
@@ -2233,6 +2248,8 @@ class VirtualRace(PlannedSession):
contact_email = models.EmailField(max_length=254,
validators=[validate_email],blank=True)
coursestandards = models.ForeignKey(StandardCollection,null=True,on_delete=models.SET_NULL)
def __str__(self):
name = self.name
@@ -3790,20 +3807,3 @@ class ShareKey(models.Model):
@property
def expiration_date(self):
return self.creation_date + datetime.timedelta(self.expiration_seconds)
class StandardCollection(models.Model):
name = models.CharField(max_length=150)
class CourseStandard(models.Model):
name = models.CharField(max_length=150)
coursedistance = models.IntegerField()
coursestandard = models.FloatField() # average boat speed
agemin = models.IntegerField(default=0)
agemax = models.IntegerField(default=120)
boatclass = models.CharField(max_length=150) # corresponds to workout workouttype
boattype = models.CharField(choices=boattypes,max_length=50,default='1x')
sex = models.CharField(max_length=150)
weightclass = models.CharField(max_length=150)
adaptiveclass = models.CharField(choices=mytypes.adaptivetypes,max_length=50,default="None")
skillclass = models.CharField(max_length=150)
standardcollection = models.ForeignKey(StandardCollection,on_delete=models.CASCADE)