title: Django template length attribute behaves strange
body: <p>I have encountered a weird behavior. And not sure how I should change it to get what I want.</p>
  
  <p>Example:</p>
  
  <pre><code>{% if chapters|length &gt; 0 %}
  Chapters:
  &lt;div id="left_menu"&gt;
      &lt;ul&gt;
      {% for chapter in chapters %}
          &lt;li&gt;&lt;a href=""&gt;{{ chapter }}&lt;/a&gt;&lt;/li&gt;
      {% endfor %}
      &lt;/ul&gt;
  &lt;/div&gt;
  {% endif %}
  </code></pre>
  
  <p>Sometimes however my queryset is empty.
  When I get this length in the shell it returns 0. So I assumed this would work.
  However, when the queryset <code>chapters</code> is empty it still shows my <code>Chapters:</code> and the div inside the page source.
  What is going on here and how can I get the result I want?</p>
  
  <p>chapters:</p>
  
  <pre><code>chapters = Chapter.objects.filter(campaign=campaign).order_by("number")
  </code></pre>
  
  <p>just a normal queryset that might be empty.</p>