title: Django templates problem — {% if object|length > 4 %} raises TemplateDoesNotExist: 500.html
body: <p>I have the following in my template. </p>
  
  <pre><code>{% block content %}
      {% for album in albumsList %}
          {% if fotosList %}
              &lt;div class="photoalbum-wrapper"&gt;
                  &lt;h3&gt;{{ album.title }}&lt;/h3&gt;
                  &lt;ul class="photoalbum"&gt;
                      {% for foto in fotosList %}&lt;li&gt;item&lt;/li&gt;{% endfor %}
                  &lt;/ul&gt;
                  {% if fotosList|length &gt; 4 %}
                      &lt;a href="#" class="trigger"&gt;больше &lt;span&gt;&amp;#9660;&lt;/span&gt;&lt;/a&gt;
                  {% endif %}
              &lt;/div&gt;
          {% endif %}  
      {% endfor %}
  {% endblock %}
  </code></pre>
  
  <p>And it raises TemplateDoesNotExist: 500.html.</p>
  
  <p>If i write simple <code>{{ fotoList|length }}</code> it works okay.</p>