adding rpe and goldmedalstandard
This commit is contained in:
@@ -1656,7 +1656,7 @@ def getfatigues(
|
||||
weight = 0
|
||||
for w in ws:
|
||||
weight += factor*getattr(w,metricchoice)
|
||||
if getattr(w,metricchoice) == 0:
|
||||
if getattr(w,metricchoice) <= 0:
|
||||
if metricchoice == 'rscore' and w.hrtss != 0:
|
||||
weight+= factor*w.hrtss
|
||||
else:
|
||||
|
||||
@@ -2904,6 +2904,15 @@ class Workout(models.Model):
|
||||
privacychoices = mytypes.privacychoices
|
||||
adaptivetypes = mytypes.adaptivetypes
|
||||
boatbrands = mytypes.boatbrands
|
||||
rpechoices = (
|
||||
(1,'Very Easy (reading a book, watching television)'), # 20 TSS / hour
|
||||
(2,'Easy (talk, breathe normally, feels comfortable)'), # 30 TSS / hour
|
||||
(4,'Moderate (talk in short spurts, breathing more labored, in comfort zone but working)'), # 50 TSS/hour
|
||||
(6,'Somewhat Hard'), # 70 TSS / hour
|
||||
(8,'Hard (could barely talk, breathing heavily)'), # 100 TSS / hour
|
||||
(9,'Very Hard (outside comfort zone)'), # 120 TSS / hour
|
||||
(10,'Max Effort (could barely remember your name)') # 140 TSS / hour
|
||||
)
|
||||
|
||||
user = models.ForeignKey(Rower,on_delete=models.CASCADE)
|
||||
team = models.ManyToManyField(Team,blank=True)
|
||||
@@ -2931,12 +2940,18 @@ class Workout(models.Model):
|
||||
distance = models.IntegerField(default=0,blank=True)
|
||||
duration = models.TimeField(blank=True)
|
||||
dragfactor = models.IntegerField(default=0,blank=True)
|
||||
|
||||
# scores
|
||||
trimp = models.IntegerField(default=-1,blank=True)
|
||||
rscore = models.IntegerField(default=-1,blank=True)
|
||||
hrtss = models.IntegerField(default=-1,blank=True)
|
||||
normp = models.IntegerField(default=-1,blank=True)
|
||||
normv = models.FloatField(default=-1,blank=True)
|
||||
normw = models.FloatField(default=-1,blank=True)
|
||||
goldmedalstandard = models.FloatField(default=-1,blank=True)
|
||||
rpe = models.IntegerField(default=0,blank=True,choices=rpechoices,
|
||||
verbose_name='Rate of Perceived Exertion')
|
||||
|
||||
weightcategory = models.CharField(
|
||||
default="hwt",
|
||||
max_length=10,
|
||||
@@ -3546,6 +3561,7 @@ class WorkoutForm(ModelForm):
|
||||
'dragfactor',
|
||||
'weightcategory',
|
||||
'adaptiveclass',
|
||||
'rpe',
|
||||
'notes',
|
||||
'rankingpiece',
|
||||
'duplicate',
|
||||
|
||||
@@ -4355,6 +4355,9 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
|
||||
notes = form.cleaned_data['notes']
|
||||
newdragfactor = form.cleaned_data['dragfactor']
|
||||
thetimezone = form.cleaned_data['timezone']
|
||||
rpe = form.cleaned_data['rpe']
|
||||
if not rpe:
|
||||
rpe = -1
|
||||
|
||||
try:
|
||||
ps = form.cleaned_data['plannedsession']
|
||||
@@ -4421,6 +4424,7 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
|
||||
row.weightcategory = weightcategory
|
||||
row.adaptiveclass = adaptiveclass
|
||||
row.notes = notes
|
||||
row.rpe = rpe
|
||||
row.duration = duration
|
||||
row.distance = distance
|
||||
row.boattype = boattype
|
||||
|
||||
Reference in New Issue
Block a user