rough version of comparison
This commit is contained in:
@@ -2036,7 +2036,7 @@ def team_comparison_select(request,
|
||||
form = WorkoutMultipleCompareForm()
|
||||
form.fields["workouts"].queryset = workouts
|
||||
|
||||
chartform = ChartParamChoiceForm()
|
||||
chartform = ChartParamChoiceForm(initial={'teamid':theteam.id})
|
||||
|
||||
return render(request, 'team_compare_select.html',
|
||||
{'workouts': workouts,
|
||||
@@ -2067,15 +2067,25 @@ def multi_compare_view(request):
|
||||
workouts = cd['workouts']
|
||||
xparam = chartform.cleaned_data['xparam']
|
||||
yparam = chartform.cleaned_data['yparam']
|
||||
plottype = chartform.cleaned_data['plottype']
|
||||
teamid = chartform.cleaned_data['teamid']
|
||||
ids = [w.id for w in workouts]
|
||||
labeldict = {
|
||||
w.id: w.__unicode__() for w in workouts
|
||||
}
|
||||
|
||||
res = interactive_multiple_compare_chart(ids,xparam,yparam,
|
||||
promember=promember)
|
||||
promember=promember,
|
||||
plottype=plottype,
|
||||
labeldict=labeldict)
|
||||
script = res[0]
|
||||
div = res[1]
|
||||
|
||||
return render(request,'multicompare.html',
|
||||
{'interactiveplot':script,
|
||||
'the_div':div,
|
||||
'promember':promember,
|
||||
'teamid':teamid,
|
||||
})
|
||||
else:
|
||||
return HttpResponse("Form is not valid")
|
||||
|
||||
Reference in New Issue
Block a user