Private
Public Access
1
0

usersmooth

This commit is contained in:
Sander Roosendaal
2020-11-04 21:51:17 +01:00
parent d8c198f3b2
commit 33b4411a6f
5 changed files with 61 additions and 3 deletions

View File

@@ -84,6 +84,14 @@ favanalysischoices = (
('cp','Critical Power'),
)
smoothingchoices = (
(1,1),
(2,2),
(4,4),
(8,8),
(16,16),
)
def half_year_from_now():
return (datetime.datetime.now(tz=timezone.utc)+timezone.timedelta(days=182)).date()
@@ -991,6 +999,9 @@ class Rower(models.Model):
max_length=100,
verbose_name='Favorite Analysis')
usersmooth = models.IntegerField(default=1,choices=smoothingchoices,
verbose_name="Chart Smoothing")
staticchartonupload = models.CharField(default='None',choices=plotchoices,
max_length=100,
verbose_name='Generate a static chart automatically on upload')
@@ -3778,6 +3789,7 @@ class AccountRowerForm(ModelForm):
'getimportantemails',
'defaulttimezone','showfavoritechartnotes',
'fav_analysis',
'usersmooth',
'defaultlandingpage',
'offercoaching','autojoin','emailalternatives']
@@ -3817,7 +3829,7 @@ class AccountRowerForm(ModelForm):
class StaticChartRowerForm(ModelForm):
class Meta:
model = Rower
fields = ['staticgrids','slowpaceerg','fastpaceerg','slowpaceotw','fastpaceotw','staticchartonupload','fav_analysis']
fields = ['usersmooth','staticgrids','slowpaceerg','fastpaceerg','slowpaceotw','fastpaceotw','staticchartonupload','fav_analysis']
def __init__(self, *args, **kwargs):
super(StaticChartRowerForm, self).__init__(*args, **kwargs)