diff --git a/rowers/forms.py b/rowers/forms.py index 1ad57343..2bb383e7 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -540,7 +540,7 @@ class TrendFlexModalForm(forms.Form): initial = types.waterboattype) rankingonly = forms.BooleanField(initial=False, label='Only Ranking Pieces', - required=True) + required=False) # This form sets options for the summary stats page diff --git a/rowers/models.py b/rowers/models.py index 4e877fd3..38151ee3 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -935,17 +935,31 @@ class TrainingTarget(models.Model): default=half_year_from_now) notes = models.TextField(max_length=300,blank=True) + def __unicode__(self): + date = self.date + name = self.name + ownerfirst = self.rower.user.first_name + ownerlast = self.rower.user.last_name + + stri = u'{ownerfirst} {ownerlast} {d} {n}'.format( + ownerfirst = ownerfirst, + ownerlast = ownerlast, + d = date.strftime('%Y-%m-%d'), + n = name + ) + + return stri + class TrainingTargetForm(ModelForm): class Meta: model = TrainingTarget fields = ['name','date','notes'] widgets = { - 'date': SelectDateWidget( - years=range( - timezone.now().year-1,timezone.now().year+1)), + 'date': AdminDateWidget() } + # SportTracks has a TrainingGoal like this #class TrainingGoal(models.Model): # rower = models.ForeignKey(Rower) @@ -976,14 +990,19 @@ class TrainingPlanForm(ModelForm): fields = ['name','target','startdate','enddate'] widgets = { - 'startdate': SelectDateWidget( - years=range( - timezone.now().year-1,timezone.now().year+1)), - 'enddate': SelectDateWidget( - years=range( - timezone.now().year-1,timezone.now().year+1)), + 'startdate': AdminDateWidget(), + 'enddate': AdminDateWidget() } + def __init__(self,*args, **kwargs): + targets = kwargs.pop('targets',None) + super(TrainingPlanForm, self).__init__(*args, **kwargs) + + if targets: + targetchoices = [(x.id,x) for x in targets] + targetchoices.append((None,'---')) + self.fields['target'].choices = targetchoices + cycletypechoices = ( ('filler','System Defined'), diff --git a/rowers/templates/trainingplan_create.html b/rowers/templates/trainingplan_create.html new file mode 100644 index 00000000..1a4f2c29 --- /dev/null +++ b/rowers/templates/trainingplan_create.html @@ -0,0 +1,117 @@ +{% extends "base.html" %} +{% load staticfiles %} +{% load rowerfilters %} + +{% block title %}Rowsandall Training Plans{% endblock %} + +{% block scripts %} + +{% endblock %} + +{% block content %} + + +
| Target Date | +Name | +Notes | +
|---|---|---|
| {{ target.date }} | +{{ target.name }} | +{{ target.notes }} | +
| Start Date | +End Date | +Name | +
|---|---|---|
| {{ plan.startdate }} | +{{ plan.enddate }} | +{{ plan.name }} | +
No plans found
+ {% endif %} + +- This is an experimental page which just lists a bunch of statistics for + This page lists a bunch of statistics for your workout. The mean is of a metric is the mean with equal weight for each stroke. The time weighted mean takes into account the stroke duration. @@ -43,76 +43,77 @@ If your data source allows, this will show or hide strokes taken during rest intervals.
| Metric | -Value | -
|---|---|
| Mean | {{ value.mean|floatformat:-2 }} | -
| Time Weighted Mean | {{ value.wmean|floatformat:-2 }} | -
| Minimum | {{ value.min|floatformat:-2 }} | -
| 25% | {{ value.firstq|floatformat:-2 }} | -
| Median | {{ value.median|floatformat:-2 }} | -
| 75% | {{ value.thirdq|floatformat:-2 }} | -
| Maximum | {{ value.max|floatformat:-2 }} | -
| Standard Deviation | {{ value.std|floatformat:-2 }} | -
rPower: Equivalent steady state power for the duration of the workout.
+Heart Rate Drift: Comparing heart rate normalized for average power for the first and second half of the workout
+TRIMP: TRaining IMPact. A way to combine duration and heart rate into a single number.
+rScore: Score based on rPower and workout duration to estimate training effect
+rScore (HR): Score based on heart rate, designed to give values comparable to rScore. Used instead of rScore for workouts without power data.
+ {% if otherstats %} -rPower: Equivalent steady state power for the duration of the workout.
-Heart Rate Drift: Comparing heart rate normalized for average power for the first and second half of the workout
-TRIMP: TRaining IMPact. A way to combine duration and heart rate into a single number.
-rScore: Score based on rPower and workout duration to estimate training effect
-rScore (HR): Score based on heart rate, designed to give values comparable to rScore. Used instead of rScore for workouts without power data.
- -| Metric | -Value | -Unit | -
|---|---|---|
| {{ value.verbose_name }} | -{{ value.value }} | -{{ value.unit }} | -
| Metric | +Value | +Unit | +
|---|---|---|
| {{ value.verbose_name }} | +{{ value.value }} | +{{ value.unit }} | +
| Metric | +Mean | +Time Weighted Mean | +Minimum | +25% | +Median | +75% | +Maximum | +Standard Deviation | +
|---|---|---|---|---|---|---|---|---|
| {{ value.verbosename }} | +{{ value.mean|floatformat:-2 }} | +{{ value.wmean|floatformat:-2 }} | +{{ value.min|floatformat:-2 }} | +{{ value.firstq|floatformat:-2 }} | +{{ value.median|floatformat:-2 }} | +{{ value.thirdq|floatformat:-2 }} | +{{ value.max|floatformat:-2 }} | +{{ value.std|floatformat:-2 }} | +
This matrix indicates a positive (+) or negative (-) correlation between two parameters. The Spearman correlation coefficient has values between +1 and -1. Positive correlation between two metrics means that if one metric increases, the other value is also likely to increase. Negative is the opposite. The further from zero, the higher the likelyhood.
diff --git a/rowers/urls.py b/rowers/urls.py
index a423bb70..5e0b41e0 100644
--- a/rowers/urls.py
+++ b/rowers/urls.py
@@ -419,6 +419,8 @@ urlpatterns = [
url(r'^workout/compare/(?P