티스토리 뷰

공부

[Django] check number of array by templates

승가비 2020. 10. 17. 20:20
728x90
{% if myarr|length > 1 %}
<!-- printing some html here -->
{% endif %}

https://stackoverflow.com/questions/1700809/checking-the-number-of-elements-in-an-array-in-a-django-template

 

Checking the number of elements in an array in a Django template

I want to see if the number of elements in an array in my Django template is greater than 1. Can i use the following syntax for doing that ? {% if {{myarr|length}} > 1 %}

 

728x90

'공부' 카테고리의 다른 글

[Sh] curl  (0) 2020.10.17
[CSS] align center  (0) 2020.10.17
[Logstash] multiple inputs  (0) 2020.10.16
[MySQL] rename table, column, type  (0) 2020.10.16
[Network] L4 system deploy  (0) 2020.10.16
댓글