From dde791374cdc76154e85714d445e6931ff124856 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 4 Nov 2020 19:12:19 +0100 Subject: [PATCH] adding favorite analysis to workouts list --- rowers/models.py | 20 +++++++++---------- rowers/templates/list_workouts.html | 7 +++++++ rowers/templatetags/rowerfilters.py | 31 ++++++++++++++++++++++++++++- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/rowers/models.py b/rowers/models.py index dee8372b..1e6e9e00 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -74,6 +74,16 @@ timezones = ( (x,x) for x in pytz.common_timezones ) +favanalysischoices = ( + ('compare','Compare'), + ('flexall','Cumulative Flex Chart'), + ('histogram','Histogram'), + ('stats','Statistics'), + ('boxplot','Box Chart'), + ('trendflex','Trend Flex'), + ('cp','Critical Power'), +) + def half_year_from_now(): return (datetime.datetime.now(tz=timezone.utc)+timezone.timedelta(days=182)).date() @@ -977,16 +987,6 @@ class Rower(models.Model): slowpaceotw = models.DurationField(default=otwpaceslow,verbose_name='Slowest OTW Pace') fastpaceotw = models.DurationField(default=otwpacefast,verbose_name='Fastest OTW Pace') - favanalysischoices = ( - ('compare','Compare'), - ('flexall','Cumulative Flex Chart'), - ('histogram','Histogram'), - ('stats','Statistics'), - ('boxplot','Box Chart'), - ('trendflex','Trend Flex'), - ('cp','Critical Power'), - ) - fav_analysis = models.CharField(default='compare',choices=favanalysischoices, max_length=100, verbose_name='Favorite Analysis') diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index 4a603cc0..69b39d1f 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -242,6 +242,13 @@   {% endif %} + + + + +