register and withdraw done
This commit is contained in:
@@ -422,6 +422,12 @@ def course_length(course):
|
||||
|
||||
return int(totaldist)
|
||||
|
||||
sexcategories = (
|
||||
('male','male'),
|
||||
('female','female'),
|
||||
('not specified','not specified'),
|
||||
)
|
||||
|
||||
# Extension of User with rowing specific data
|
||||
class Rower(models.Model):
|
||||
weightcategories = (
|
||||
@@ -429,11 +435,6 @@ class Rower(models.Model):
|
||||
('lwt','light-weight'),
|
||||
)
|
||||
|
||||
sexcategories = (
|
||||
('male','male'),
|
||||
('female','female'),
|
||||
('not specified','not specified'),
|
||||
)
|
||||
|
||||
stravatypes = (
|
||||
('Ride','Ride'),
|
||||
@@ -1066,6 +1067,10 @@ class VirtualRace(PlannedSession):
|
||||
end_time = models.TimeField(blank=True,null=True)
|
||||
country = models.CharField(max_length=100,blank=True)
|
||||
|
||||
timezone = models.CharField(default='UTC',
|
||||
choices=timezones,
|
||||
max_length=100)
|
||||
|
||||
phone_regex = RegexValidator(
|
||||
regex=r'^\+?1?\d{9,15}$',
|
||||
message="Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed."
|
||||
@@ -1087,6 +1092,8 @@ class VirtualRace(PlannedSession):
|
||||
)
|
||||
|
||||
return stri
|
||||
|
||||
|
||||
|
||||
# Date input utility
|
||||
class DateInput(forms.DateInput):
|
||||
@@ -1199,12 +1206,12 @@ class PlannedSessionFormSmall(ModelForm):
|
||||
'manager': forms.HiddenInput(),
|
||||
}
|
||||
|
||||
boattypes = types.boattypes
|
||||
|
||||
# Workout
|
||||
class Workout(models.Model):
|
||||
workouttypes = types.workouttypes
|
||||
workoutsources = types.workoutsources
|
||||
boattypes = types.boattypes
|
||||
privacychoices = types.privacychoices
|
||||
|
||||
user = models.ForeignKey(Rower)
|
||||
@@ -1317,6 +1324,24 @@ def auto_delete_strokedata_on_delete(sender, instance, **kwargs):
|
||||
conn.close()
|
||||
engine.dispose()
|
||||
|
||||
# Virtual Race results (for keeping results when workouts are deleted)
|
||||
class VirtualRaceResult(models.Model):
|
||||
user = models.ForeignKey(Rower)
|
||||
username = models.CharField(max_length=150)
|
||||
workout = models.ForeignKey(Workout)
|
||||
race = models.ForeignKey(VirtualRace)
|
||||
duration = models.TimeField(default=3600)
|
||||
boattype = models.CharField(choices=boattypes,max_length=40,
|
||||
default='1x',
|
||||
verbose_name = 'Boat Type'
|
||||
)
|
||||
|
||||
sex = models.CharField(default="not specified",
|
||||
max_length=30,
|
||||
choices=sexcategories,
|
||||
verbose_name='Gender')
|
||||
|
||||
|
||||
from rowers.metrics import rowingmetrics
|
||||
|
||||
strokedatafields = {
|
||||
|
||||
Reference in New Issue
Block a user