From 08b49b32bbd8bb6ea4a8b0ea3a1ecbbfb1b41318 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Thu, 12 Oct 2017 12:37:33 +0200 Subject: [PATCH] more around default fav charts --- rowers/metrics.py | 22 +++++++++++++++------- rowers/models.py | 13 +++++++++++-- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/rowers/metrics.py b/rowers/metrics.py index 27694003..b2986565 100644 --- a/rowers/metrics.py +++ b/rowers/metrics.py @@ -245,7 +245,7 @@ defaultfavoritecharts = ( 'plottype':'line', 'workouttype':'both', 'reststrokes':True, - 'notes':'Some Notes 1', + 'notes':"""This chart shows your pace and stroke rate versus time. """, }, { 'yparam1':'pace', @@ -254,7 +254,9 @@ defaultfavoritecharts = ( 'plottype':'line', 'workouttype':'both', 'reststrokes':True, - 'notes':'Some Notes 2', + 'notes':"""This chart shows your pace and heart rate versus time. +Heart rate values will be shown only when it is in your data, i.e. +in case you recorded your heart rate during your workout""", }, { 'yparam1':'distanceperstroke', @@ -263,7 +265,8 @@ defaultfavoritecharts = ( 'plottype':'line', 'workouttype':'otw', 'reststrokes':True, - 'notes':'Some Notes 3', + 'notes':"""This chart shows the Distance covered per stroke, and your +heart rate versus time. """, }, { 'yparam1':'strokeenergy', @@ -272,16 +275,20 @@ defaultfavoritecharts = ( 'plottype':'line', 'workouttype':'ote', 'reststrokes':True, - 'notes':'Some Notes 3', + 'notes':"""This chart shows the Work per Stroke and your heart rate +plotted versus time. """, }, { 'yparam1':'distanceperstroke', 'yparam2':'None', 'xparam':'spm', - 'plottype':'line', + 'plottype':'scatter', 'workouttype':'otw', 'reststrokes':True, - 'notes':'Some Notes 4', + 'notes':"""This chart shows the Distance per Stroke versus stroke +stroke rate. You should see a steady decline of the Distance per Stroke +as you increase stroke rate. Typical values are > 10m for steady state +dropping to 8m for race pace in the single.""", }, { 'yparam1':'strokeenergy', @@ -290,6 +297,7 @@ defaultfavoritecharts = ( 'plottype':'line', 'workouttype':'ote', 'reststrokes':True, - 'notes':'Some Notes 4', + 'notes':"""This chart shows the Work per Stroke versus Stroke Rate. +This value should be fairly constant across all stroke rates.""", }, ) diff --git a/rowers/models.py b/rowers/models.py index 2913c6be..af0b3374 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -298,6 +298,10 @@ class Rower(models.Model): defaulttimezone = models.CharField(default='UTC',max_length=100, choices=timezones, verbose_name='Default Time Zone') + + # Show flex chart notes + showfavoritechartnotes = models.BooleanField(default=True, + verbose_name='Show Notes for Favorite Charts') def __str__(self): return self.user.username @@ -353,7 +357,11 @@ class FavoriteForm(ModelForm): class Meta: model = FavoriteChart fields = ['xparam','yparam1','yparam2', - 'plottype','workouttype','reststrokes'] + 'plottype','workouttype','reststrokes','notes'] + widgets = { + 'notes': forms.Textarea, + } + # To generate favorite chart forms on the fly class BaseFavoriteFormSet(BaseFormSet): @@ -830,7 +838,8 @@ class RowerPowerZonesForm(ModelForm): class AccountRowerForm(ModelForm): class Meta: model = Rower - fields = ['weightcategory','getemailnotifications','defaulttimezone'] + fields = ['weightcategory','getemailnotifications', + 'defaulttimezone','showfavoritechartnotes'] class UserForm(ModelForm): class Meta: