From: Frédéric Péters Date: Sat, 14 Sep 2013 17:11:56 +0000 (+0200) Subject: performance: use .exists to check for non empty queryset X-Git-Tag: v2021~816 X-Git-Url: https://git.0d.be/?p=panikweb.git;a=commitdiff_plain;h=c61a52a0497b8cedee659d0a03762ea3cd4f6b1a performance: use .exists to check for non empty queryset --- diff --git a/panikweb_templates/templates/emissions/emission_detail.html b/panikweb_templates/templates/emissions/emission_detail.html index 945d6c0..e576898 100644 --- a/panikweb_templates/templates/emissions/emission_detail.html +++ b/panikweb_templates/templates/emissions/emission_detail.html @@ -8,7 +8,7 @@ {% emission_nav %} {% endblock %} {% block main %} -
+
@@ -46,7 +46,7 @@ {% endfor %}
{% endif %} - {% if episodes %} + {% if episodes.exists %}
{% with episodes|slice:"0:1" as episodes %} diff --git a/panikweb_templates/templates/emissions/nav.html b/panikweb_templates/templates/emissions/nav.html index 1519daf..beab401 100644 --- a/panikweb_templates/templates/emissions/nav.html +++ b/panikweb_templates/templates/emissions/nav.html @@ -55,7 +55,7 @@
- {% if episodes %} + {% if episodes.exists %}