Simple question. I have a list in my template and want to output the length of the list. Do I have to calculate this in my view and hand it over via my context?
<p>the size of the list is {{??}}</p> {% for element in list %} <p>element.Name</p> {% end for %}
Use length
filter:
{{ some_list|length }}
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