TEMPLATE_STRING_IF_INVALID) or
settings.TEMPLATE_STRING_IF_INVALID
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of Mikkel Kromann
Sent: Friday, June 15, 2018 6:36 AM
To: Django users
Subject: Re: Nested for loops in templates
Thanks Matthew.
The field_list is a lis
Thanks Matthew.
The field_list is a list strings containnig the field names hardcoded in
Models.py by the programmer.
I.e. the field names that shoud appear in the Class Based Views.
So, perhaps this answers my question to Vijay - that the row in the
iteration is in fact the Model object.
And t
Thank you Vijay.
That link seems to be a feasible path for me to take (reproduced below).
Perhaps you or others can help me with an additional question (I am a bit
new to both Python and Django), that I'm struggling with:
Which type of data structure is Django iterating over in the templates
(i
field is a string – a name of a field, field is not actually an attribute of
row. You’ll need a template tag to get the attribute named field from row.
This StackOverflow question may help you:
https://stackoverflow.com/questions/844746/performing-a-getattr-style-lookup-in-a-django-template?utm_m
As far as I know you can't do it directly in the templating system
Yo could write a template tag as described here
https://stackoverflow.com/questions/2894365/use-variable-as-dictionary-key-in-django-template/10700142#10700142
or use a different data structure, for example each row as a list of
5 matches
Mail list logo