Private
Public Access
1
0

added registration form

This commit is contained in:
Sander Roosendaal
2018-04-20 13:38:00 +02:00
parent 82da46ef0c
commit f70a2b2510
6 changed files with 199 additions and 28 deletions

View File

@@ -427,14 +427,14 @@ sexcategories = (
('female','female'),
('not specified','not specified'),
)
weightcategories = (
('hwt','heavy-weight'),
('lwt','light-weight'),
)
# Extension of User with rowing specific data
class Rower(models.Model):
weightcategories = (
('hwt','heavy-weight'),
('lwt','light-weight'),
)
stravatypes = (
('Ride','Ride'),
@@ -1327,11 +1327,15 @@ def auto_delete_strokedata_on_delete(sender, instance, **kwargs):
# Virtual Race results (for keeping results when workouts are deleted)
class VirtualRaceResult(models.Model):
user = models.ForeignKey(Rower)
teamname = models.CharField(max_length=20,verbose_name = 'Team Name',
blank=True,null=True)
username = models.CharField(max_length=150)
workout = models.ForeignKey(Workout)
weightcategory = models.CharField(default="hwt",max_length=10)
workout = models.ForeignKey(Workout,blank=True,null=True)
weightcategory = models.CharField(default="hwt",max_length=10,
choices=weightcategories,
verbose_name='Weight Category')
race = models.ForeignKey(VirtualRace)
duration = models.TimeField(default=3600)
duration = models.TimeField(default=datetime.time(1,0))
boattype = models.CharField(choices=boattypes,max_length=40,
default='1x',
verbose_name = 'Boat Type'
@@ -1344,7 +1348,12 @@ class VirtualRaceResult(models.Model):
age = models.IntegerField(null=True)
class VirtualRaceResultForm(ModelForm):
class Meta:
model = VirtualRaceResult
fields = ['teamname','weightcategory','boattype','age']
from rowers.metrics import rowingmetrics
strokedatafields = {