Friday, September 23, 2011

Iterating through two lists in a Django template

http://stackoverflow.com/questions/2415865/iterating-through-two-lists-in-django-templates

Access array elements in a Django template

http://stackoverflow.com/questions/1700661/access-array-elements-in-a-django-template


Remember that the dot notation in a Django template is used for four different notations in Python. In a template, foo.bar can mean any of:

foo[bar] # dictionary lookup
foo.bar # attribute lookup
foo.bar() # method call
foo[bar] # list-index lookup