Re: Template Variables as Indexes

2009-04-24 Thread Doug B
Might not be the easiest way, but you could use a custom filter: def formsbyfield(forms,field): """ Given a list of similar forms, and a field name, return a list of formfields, one from each form. """ return [form.fields.get(field,'') for form in forms] register.filter('forms

Template Variables as Indexes

2009-04-24 Thread NewSpire
I have a list of forms, all of the same type, where I would like to list each form side by side with the fields listed vertically. The root of the problem is that I need to use a template variable as an index on another template variable. Something like this. {% for field in forms.0 %} {{