added coursestandards to virtualrace
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user