I am trying to make a table with values I get from a list but I keep getting the error "Could not parse the remainder: '[0]' from 'item[0]'" whenever I try to access an item in a list inside the main list.
The part of the code that is giving me problems is:
{% for item in lista_completa %}
<tr>
<td>
{{ item[0] }}
</td>
<td>
{{ item[1] }}
</td>
</tr>
{% endfor %}
And the list is something like this:
lista_completa = [[1,'a'],[1,'b'],[3,'c']]
I tried using {% item[0] %} instead but I got the same error.
Thanks
You would write the following to get item 0
:
{{ item.0 }}
Similarly, to get the first item of the first item you'd write:
{{ item.0.0 }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With