adding fav_analysis and 2 forms to change it
This commit is contained in:
@@ -977,6 +977,20 @@ class Rower(models.Model):
|
|||||||
slowpaceotw = models.DurationField(default=otwpaceslow,verbose_name='Slowest OTW Pace')
|
slowpaceotw = models.DurationField(default=otwpaceslow,verbose_name='Slowest OTW Pace')
|
||||||
fastpaceotw = models.DurationField(default=otwpacefast,verbose_name='Fastest 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')
|
||||||
|
|
||||||
staticchartonupload = models.CharField(default='None',choices=plotchoices,
|
staticchartonupload = models.CharField(default='None',choices=plotchoices,
|
||||||
max_length=100,
|
max_length=100,
|
||||||
verbose_name='Generate a static chart automatically on upload')
|
verbose_name='Generate a static chart automatically on upload')
|
||||||
@@ -3763,6 +3777,7 @@ class AccountRowerForm(ModelForm):
|
|||||||
'getemailnotifications',
|
'getemailnotifications',
|
||||||
'getimportantemails',
|
'getimportantemails',
|
||||||
'defaulttimezone','showfavoritechartnotes',
|
'defaulttimezone','showfavoritechartnotes',
|
||||||
|
'fav_analysis',
|
||||||
'defaultlandingpage',
|
'defaultlandingpage',
|
||||||
'offercoaching','autojoin','emailalternatives']
|
'offercoaching','autojoin','emailalternatives']
|
||||||
|
|
||||||
@@ -3802,7 +3817,7 @@ class AccountRowerForm(ModelForm):
|
|||||||
class StaticChartRowerForm(ModelForm):
|
class StaticChartRowerForm(ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Rower
|
model = Rower
|
||||||
fields = ['staticgrids','slowpaceerg','fastpaceerg','slowpaceotw','fastpaceotw','staticchartonupload']
|
fields = ['staticgrids','slowpaceerg','fastpaceerg','slowpaceotw','fastpaceotw','staticchartonupload','fav_analysis']
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(StaticChartRowerForm, self).__init__(*args, **kwargs)
|
super(StaticChartRowerForm, self).__init__(*args, **kwargs)
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ def rower_favoritecharts_view(request,userid=0):
|
|||||||
r.slowpaceotw = staticchartform.cleaned_data.get('slowpaceotw')
|
r.slowpaceotw = staticchartform.cleaned_data.get('slowpaceotw')
|
||||||
r.fastpaceotw = staticchartform.cleaned_data.get('fastpaceotw')
|
r.fastpaceotw = staticchartform.cleaned_data.get('fastpaceotw')
|
||||||
r.staticchartonupload = staticchartform.cleaned_data.get('staticchartonupload')
|
r.staticchartonupload = staticchartform.cleaned_data.get('staticchartonupload')
|
||||||
|
r.fav_analysis = staticchartform.cleaned_data.get('fav_analysis')
|
||||||
r.save()
|
r.save()
|
||||||
|
|
||||||
if request.method == 'POST' and 'form-TOTAL_FORMS' in request.POST:
|
if request.method == 'POST' and 'form-TOTAL_FORMS' in request.POST:
|
||||||
|
|||||||
Reference in New Issue
Block a user