python - django template group results into different javascript objects -


i have lots of entries channel(int),level(int) , entrytime(datetimefield) passing filtered results template, need create different javascript objects each channel objects name being channel number , array of values being level , entrytime entrytime being unix timestamp.

i.e.

var channel23 = [[1262905200000, 115],[1262818800000, 115],[1262732400000, 115],[1262646000000, 122],[1261954800000, 123]]  var channel11 = [[1262905200000, 60],[1262818800000, 60],[1262732400000, 60],[1262646000000, 55]]; 

thank you.

if else has got working using regroup in template, snippet below:

{% regroup results|dictsort:"channel" channel results_list %}


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -