You don't need {{ }} within the {% for .. %} tag. Try simply {% for tmpDict in assayDict.methods %}
--Ned. http://nedbatchelder.com/blog [EMAIL PROTECTED] wrote: > Hello All, > > I'm running into a little trouble using the template system of > django. > In python i created a list containing the following info > > [ > {'value':1,"list":[{'assayValue':"20",assayName:"test1"}, > {'assayValue':"21",assayName:"test2"}, > {'assayValue':"22",assayName:"test3"}]}, > {'value':2,"list":[{'assayValue':"10",assayName:"test5"}, > {'assayValue':"11",assayName:"test6"}]} > ] > > enz .... > > in the template system i want to create a array ( for javascript ) in > the following way: > > var secondOptions = > { > 1 :[['Beckman Coulter Electrachrom AT',101],['BioMerieux Chromostrate > ATIII',127]], > 2 :[['Trinity / Biopool Spectrolyse ATIII (anti-Xa)',103], > ['Chromogenix Coamatic Antithrombin',105],['Chromogenix Coamatic > AT-400',106]] > }; > > the template i created in order to construct this variable is the > following > > var secondOptions = > { > {% for assayDict in methodList %} > {{ assayDict.value }} :[ > {% for tmpDict in {{ assayDict.methods }} %} > > [{{tmpDict.assayName}},{{tmpDict.assayValue}}] > {% endfor %} > {% endfor %} > }; > > unfortunately this won't work, i get the following error message > 'for' statements should use the format 'for x in y': for tmpDict in > {{ assayDict.methods }} > > it seems like the var {{ assayDict.methods }} can't be put in the for > loop. > > does anyone have a idea how to construct this list based on the array > in python ? > > any help would be greatly appreciated, > > Richard > > > > -- Ned Batchelder, http://nedbatchelder.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---