made metrics and strokedata model dynamic
This commit is contained in:
@@ -48,6 +48,7 @@ from rowers.models import (
|
||||
WorkoutComment,WorkoutCommentForm,RowerExportForm,
|
||||
)
|
||||
from rowers.models import FavoriteForm,BaseFavoriteFormSet,SiteAnnouncement
|
||||
from rowers.metrics import rowingmetrics
|
||||
from django.forms.formsets import formset_factory
|
||||
import StringIO
|
||||
from django.contrib.auth.decorators import login_required,user_passes_test
|
||||
@@ -5905,6 +5906,10 @@ def workout_flexchart3_view(request,*args,**kwargs):
|
||||
axchoicesbasic.pop("cumdist")
|
||||
|
||||
if row.workouttype in ('water','coastal'):
|
||||
for name,d in rowingmetrics:
|
||||
if d['mode'] == 'erg':
|
||||
axchoicespro.pop(name)
|
||||
|
||||
return render(request,
|
||||
'flexchart3otw.html',
|
||||
{'the_script':script,
|
||||
@@ -5927,14 +5932,9 @@ def workout_flexchart3_view(request,*args,**kwargs):
|
||||
'maxfav':maxfav,
|
||||
})
|
||||
else:
|
||||
axchoicespro.pop('slip')
|
||||
axchoicespro.pop('wash')
|
||||
axchoicespro.pop('catch')
|
||||
axchoicespro.pop('finish')
|
||||
axchoicespro.pop('totalangle')
|
||||
axchoicespro.pop('effectiveangle')
|
||||
axchoicespro.pop('peakforceangle')
|
||||
axchoicespro.pop('efficiency')
|
||||
for name,d in rowingmetrics:
|
||||
if d['mode'] == 'water':
|
||||
axchoicespro.pop(name)
|
||||
|
||||
return render(request,
|
||||
'flexchart3otw.html',
|
||||
|
||||
Reference in New Issue
Block a user