Private
Public Access
1
0

Adding Course Standard model

This commit is contained in:
Sander Roosendaal
2020-05-31 17:10:48 +02:00
parent 6d93cc62ce
commit 947b5a1d09

View File

@@ -2192,29 +2192,29 @@ class StandardCollection(models.Model):
def __str__(self):
return self.name
#class CourseStandard(models.Model):
# name = models.CharField(max_length=150)
# coursedistance = models.IntegerField()
# coursetime = models.CharField(max_length=100,default="")
# referencespeed = 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)
class CourseStandard(models.Model):
name = models.CharField(max_length=150,default='')
coursedistance = models.IntegerField(default=0)
coursetime = models.CharField(max_length=100,default="")
referencespeed = models.FloatField(default=5.0) # average boat speed
agemin = models.IntegerField(default=0)
agemax = models.IntegerField(default=120)
boatclass = models.CharField(max_length=150,default='water') # corresponds to workout workouttype
boattype = models.CharField(choices=mytypes.boattypes,max_length=50,default='1x')
sex = models.CharField(max_length=150,default='male')
weightclass = models.CharField(max_length=150,default='hwt')
adaptiveclass = models.CharField(choices=mytypes.adaptivetypes,max_length=50,default="None")
skillclass = models.CharField(max_length=150,default='Open')
standardcollection = models.ForeignKey(StandardCollection,on_delete=models.CASCADE)
# class Meta:
# unique_together = (
# ('name','standardcollection')
# )
class Meta:
unique_together = (
('name','standardcollection')
)
# def __str__(self):
# return self.name
def __str__(self):
return self.name
registerchoices = (
('windowstart','Start of challenge Window'),