title: Django template ifequal statement always true
body: <p>Hi I am building a simple blog using Python/Django. In my index.html file, I am trying to show archived posts when a button containing a month is clicked. At the moment, I am just trying to get the id of every post made in that month into a javascript array. For some reason though,it always returns true! </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function showPosts(month)
  {
  var posts_in_month=[];
  {% for post in all_posts %}
  var match = {{ post.pub_date.month }}
      {% ifequal match month %}
        posts_in_month.push({{ post.id }})
      {% endifequal %}
  {% endfor %}
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I then go on to have a switch statement where I show the contents of the array depending on the month clicked. The code definitely works, when I call an alert(month) it shows up correctly, and when I call alert({{ post.pub_date.month }}) it shows up fine as well. These are usually not the same though, why is it always evaluating the ifequal to true?</p>