I need to access data in the nested list fdata
but I get nothing when using the template variables i
& j
to access them. I can access the values using something like {{ fdata.1.0 }}
however.
Here's the context data
fdata = [[0, 0, 0], [4, 1, 2], [1, 0, 0], [0, 0, 0], [0, 0, 0]]
flabels = ['image', 'video', 'document']
users = [<User: admin>, <User: test>, <User: neouser>, <User: hmmm>, <User: justalittle>]
And this is the code in the template.
{% for file_type in flabels %}
{
{% with i=forloop.counter0 %}
label: {{file_type}},
data: [
{% for user in users %}
{% with j=forloop.counter0 %}
{{ fdata.j.i }},
{% endwith %}
{% endfor %}
],
{% endwith %}
}
{% endfor %}