title: How do I prevent blocked users from appearing in this list of users?
body: <p>Django and programming noob here. I'm making an election information app, and on an election page I want to display all of the candidates that are running in the election, but I <em>do not</em> want to display the candidates which the moderators of the election have declared a blocked user.</p>
  
  <p>I can display a list of all the candidates running in an election by using {% for candidate in election.candidate_set.all %}. However, I want to first check if the candidate is a blocked_user, and only display the candidate if they are not a blocked_user. As you can see in the template below, I thought that I could use the statement {% if candidate in election.blocked_users.all %}, but that does not work for me...</p>
  
  <p>Sorry I'm such a noob. Any help would be greatly appreciated.</p>
  
  <p><strong>election_detail.html</strong></p>
  
  <pre><code>{% for candidate in election.candidate_set.all %}
      {% if candidate in election.blocked_users.all %}
          &lt;!--do nothing--&gt;
      {% else %}    
      &lt;h3&gt;{{ candidate.name }}&lt;/h3&gt;
      {% endif %}
  {% endfor %}
  </code></pre>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Election(models.Model):
      name = models.CharField(max_length=50)
      description = models.TextField()
      first_voting_day = models.DateField()
      last_voting_day = models.DateField(null=True, blank=True)
      constituency = models.ForeignKey(Constituency)
      offices = models.ManyToManyField(Office)
      moderators = models.ManyToManyField(User, related_name='moderator')
      blocked_users = models.ManyToManyField(User, related_name='blocked_users', blank=True)
  
      def __unicode__(self):
          return unicode(self.name)
  
      def get_absolute_url(self):
          return reverse('election_detail', kwargs={'pk': str(self.id)})
  </code></pre>
  
  <p><strong>EDIT</strong> - added the view for the election</p>
  
  <p><strong>election.py</strong></p>
  
  <pre><code>class ElectionDetailView(DetailView):
      model = Election
      context_object_name = "election"
  </code></pre>