title: Django: Current login user in a query list
body: <p><strong>model.py</strong></p>
  
  <pre><code>class Question(models.Model):
      user = models.ForeignKey(User)
      title = models.CharField(max_length= 200)
      description = models.TextField()
      location = models.CharField(max_length=150)
      tags = TaggableManager()
      time = models.DateTimeField(auto_now_add=True)
  
      def __unicode__(self):
          return self.title
  
  
  class Like(models.Model):
      user = models.ManyToManyField(User, related_name='likes')
      question = models.ForeignKey(Question)
      date = models.DateTimeField(auto_now_add=True)
      likecount = models.IntegerField(default=0)
  </code></pre>
  
  <p><strong>urls.py</strong></p>
  
  <pre><code>url(r'^$', ListView.as_view(queryset= Question.objects.all(),
                  template_name="index.html")),
  </code></pre>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>{%for question in object_list %}
      {%for user_liked in question.like_set.all%}
        {% if user.username in user_liked.user.all%} `&lt;!--if current logged in user in Like model user m2m field--&gt;`
          &lt;button type="button" class="btn btn-disable" name= {{question.id}}"id="request"&gt;Liked &lt;/button&gt;  &lt;!--disable like button--&gt;
       {%else%}
         &lt;button type="button" class="btn btn-enable" name= {{question.id}}"id="request"&gt;Like &lt;/button&gt;  &lt;!--enable like button--&gt;
       {%endif%}
    {%endfor%}
  {%endfor%}
  </code></pre>
  
  <p>Problem is <strong><code>if template tag</code></strong> block doesn't work.</p>