Django - Manipulating a List of Lists

I have a function in a model that returns a list of lists - [[a1, a2], [b1, b2]]. I am submitting this for review. But how do I access each value. I want to display a1, a2, b1 and b2 separately.

+1


a source to share


1 answer


{% for item in mylist %}
  {{item.0}}<br />
  {{item.1}}
{% endfor %}

      

should be displayed



a1
a2
b1
b2

      

+4


a source







All Articles