Assume that nested_list = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
In this case, {{ nested_list.0.1 }}
would print 2
in template
Q. How can I access to nested list by variable in template ?
For example, {{ nested_list.{{ some_variable }}.1 }}
. Where some variable
contains the index that I wish to retrieve (0 in the first example). Of course, it yields TemplateSyntaxError
.