I want to display
label1 field1 field2
label2 field1 field2
label3 field1 field2
I have form with two fields - field1 and field2 and a formset
(where field1 and field2 are say text fields.)
in views.py:
----------
labels = ['label1', 'label2', 'label3']
formset = MyFormSet()
....
return render_to_response('myformset.html', {'formset': formset,
'label': labels},
context_instance=RequestContext(request))
in html:
---------
<form name="importmapform" action="." method="POST">
{% for form in formset.forms %}
{{labels}} ## HOW DO I display one label in each
row and not whole List?
{{form.field1}} {{form.field2}} <br>
{% endfor %}
</form>
I am getting following output instead of what I want as shown above.
How to do it?
['label1', 'label2','label3'] field1 field2
['label1', 'label2','label3'] field1 field2
['label1', 'label2','label3'] field1 field2
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
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.