Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check if queryset is empty django template

<ul>
{% for athlete in athlete_list %}
    <li>{{ athlete.name }}</li>
{% empty %}
    <li>Sorry, no athletes in this list.</li>
{% endfor %}
</ul>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #queryset #empty #django #template
ADD COMMENT
Topic
Name
5+4 =