title: Django if statement not working
body: <pre><code>{% extends "base.html" %}
  {% block content %}
  
  &lt;h1&gt;{{ page }}&lt;/h1&gt;
  
  {% for category in categories %}
      {% if category.page == page %}
          &lt;h2&gt;{{ category.title }}!&lt;/h2&gt;
  
      {% for item in categoryitems %}
          {{ category.title }} {{ item.category }}
          {% if item.category == category.title %}
              &lt;h3&gt;{{ item.title }}&lt;/h3&gt;
          {% endif %}
      {% endfor %}
  
      {% endif %}
  {% endfor %}
  
  {% endblock %}
  </code></pre>
  
  <p>The first statement <code>if category.page == page</code> is working fine, but the other one - <code>if item.category == category.title</code> - doesn't, for the sake of checking if everything is fine I've also added those <code>{{category.title}}</code> and <code>{{item.category}}</code> outputs and they are identical, so why doesn't the loop show me my <code>item.title</code> ? Without the <code>if</code>, it works, but, of course, shows every element in the list, which is smthn I don't need.</p>