Private
Public Access
1
0

made metrics and strokedata model dynamic

This commit is contained in:
Sander Roosendaal
2017-09-21 16:47:39 +02:00
parent 79d2c7490a
commit 6db8b17ad6
4 changed files with 292 additions and 80 deletions

View File

@@ -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',