Private
Public Access
1
0

added adaptive classes (not tested)

This commit is contained in:
Sander Roosendaal
2018-12-15 14:18:48 +01:00
parent cc2d82cf56
commit 2ffd145bca
9 changed files with 122 additions and 10 deletions

View File

@@ -538,7 +538,7 @@ weightcategories = (
# Extension of User with rowing specific data
class Rower(models.Model):
adaptivetypes = mytypes.adaptivetypes
stravatypes = (
('Ride','Ride'),
('Kitesurf','Kitesurf'),
@@ -593,6 +593,10 @@ class Rower(models.Model):
max_length=30,
choices=sexcategories)
adaptiveclass = models.CharField(choices=adaptivetypes,max_length=50,
default='None',
verbose_name='Adaptive Classification')
birthdate = models.DateField(null=True,blank=True)
# Power Zone Data
ftp = models.IntegerField(default=226,verbose_name="Functional Threshold Power")
@@ -2256,6 +2260,7 @@ class Workout(models.Model):
workouttypes = mytypes.workouttypes
workoutsources = mytypes.workoutsources
privacychoices = mytypes.privacychoices
adaptivetypes = mytypes.adaptivetypes
user = models.ForeignKey(Rower)
team = models.ManyToManyField(Team,blank=True)
@@ -2270,6 +2275,9 @@ class Workout(models.Model):
boattype = models.CharField(choices=boattypes,max_length=50,
default='1x',
verbose_name = 'Boat Type')
adaptiveclass = models.CharField(choices=adaptivetypes,max_length=50,
default='None',
verbose_name='Adaptive Classification')
starttime = models.TimeField(blank=True,null=True)
startdatetime = models.DateTimeField(blank=True,null=True)
timezone = models.CharField(default='UTC',
@@ -2426,6 +2434,9 @@ class VirtualRaceResult(models.Model):
weightcategory = models.CharField(default="hwt",max_length=10,
choices=weightcategories,
verbose_name='Weight Category')
adaptiveclass = models.CharField(default="None",max_length=50,
choices=mytypes.adaptivetypes,
verbose_name="Adaptive Class")
race = models.ForeignKey(VirtualRace)
duration = models.TimeField(default=datetime.time(1,0))
distance = models.IntegerField(default=0)
@@ -2482,6 +2493,9 @@ class IndoorVirtualRaceResult(models.Model):
weightcategory = models.CharField(default="hwt",max_length=10,
choices=weightcategories,
verbose_name='Weight Category')
adaptiveclass = models.CharField(default="None",max_length=50,
choices=mytypes.adaptivetypes,
verbose_name="Adaptive Class")
race = models.ForeignKey(VirtualRace)
duration = models.TimeField(default=datetime.time(1,0))
distance = models.IntegerField(default=0)
@@ -2533,7 +2547,7 @@ class CourseTestResult(models.Model):
class IndoorVirtualRaceResultForm(ModelForm):
class Meta:
model = IndoorVirtualRaceResult
fields = ['teamname','weightcategory','boatclass','age']
fields = ['teamname','weightcategory','boatclass','age','adaptiveclass']
def __init__(self, *args, **kwargs):
@@ -2543,7 +2557,8 @@ class IndoorVirtualRaceResultForm(ModelForm):
class VirtualRaceResultForm(ModelForm):
class Meta:
model = VirtualRaceResult
fields = ['teamname','weightcategory','boatclass','boattype','age']
fields = ['teamname','weightcategory','boatclass','boattype',
'age','adaptiveclass']
def __init__(self, *args, **kwargs):
@@ -2683,7 +2698,20 @@ class WorkoutForm(ModelForm):
# duration = forms.TimeInput(format='%H:%M:%S.%f')
class Meta:
model = Workout
fields = ['name','date','starttime','timezone','duration','distance','workouttype','boattype','weightcategory','notes','rankingpiece','duplicate','plannedsession']
fields = ['name',
'date',
'starttime',
'timezone',
'duration',
'distance',
'workouttype',
'boattype',
'weightcategory',
'adaptiveclass',
'notes',
'rankingpiece',
'duplicate',
'plannedsession']
widgets = {
'date': AdminDateWidget(),
'notes': forms.Textarea,
@@ -2930,6 +2958,7 @@ class AccountRowerForm(ModelForm):
class Meta:
model = Rower
fields = ['sex','birthdate','weightcategory',
'adaptiveclass',
'getemailnotifications',
'getimportantemails',
'defaulttimezone','showfavoritechartnotes',