title: Displaying reverse many-to-many in Django Templates
body: <p>I'm in the midst of creating an alarm/notification system for a small Sales CRM app.
  I have a Lead_Contact model that is used to store a client's name, address, etc. as well as a Contact_Notifier models that is being used to keep track of when a client was first contacted, the last contact, and when we are going to next contact them. </p>
  
  <p>For reference, here is the relevant snippets of the models:</p>
  
  <pre><code>class Lead_Contact(models.Model):
  
      first_contacted = models.ManyToManyField('Contact_Notifier', related_name='first_contact', null=True,blank=True)
      last_contacted = models.ManyToManyField('Contact_Notifier', related_name='last_contact', null=True,blank=True)
      next_contacted = models.ManyToManyField('Contact_Notifier', related_name='next_contact', null=True,blank=True)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class Contact_Notifier(models.Model):
      WHEN_CHOICES = (
       ('F', 'First'),
       ('L', 'Last'),
       ('N', 'Next'),
      )
  
      when_contact = models.CharField(max_length=1, choices=WHEN_CHOICES)
      contact_date = models.DateField(blank = True, null=True)
      contact_time = models.TimeField(blank = True, null=True)
      contact_message = models.TextField(blank=True)
      is_finished = models.BooleanField(default=False)
  </code></pre>
  
  <p>I have created a view function that essentially filters Contact_Notifier to display all of my next_contacted objects for the individual users of the CRM app, like such:</p>
  
  <pre><code>def urgent_notifier(request, template_name='urgent_results.html'):
      error = ""
  
      selected_user = user_filter(request)
      results=Contact_Notifier.objects.filter( Q(user=selected_user) | Q(user="AU")).filter(when_contact = 'N').filter(contact_date__lte=datetime.date.today()) 
      return render_to_response(template_name, {'issues': results, 'error': error}) 
  </code></pre>
  
  <p>Now in my template, I'm displaying my queryset, but having issues when I attempt to display fields from the Lead_Contact model; I've read over the Django book and Django Project documentation, but I just can't seem to make the reverse relationship displays work! Here's the relevant template code:</p>
  
  <pre><code>{% if issues %} 
   {% for issue in issues %}
    &lt;form action="/results/{{issue.id}}/normalize/" method="post"&gt;
     &lt;input type="submit" value="remove" /&gt;&lt;b&gt;Contact Time:&lt;/b&gt; {{issue.contact_date}} &lt;b&gt; at &lt;/b&gt; {{issue.contact_time}} &lt;b&gt;via&lt;/b&gt; {{issue.get_contact_type_display}} &lt;br&gt;
    &lt;!-- Here is where my problems start  --&gt; 
     {% for item in issue.lead_contact_set.all %}
      {{ item.salutation }} &lt;a href="../results/{{issue.pk}}/"&gt; {{ item.first_name }} {{ item.last_name }} &lt;/a&gt; &lt;b&gt; Phone:&lt;/b&gt; {{ item.phone_1 }} {{ issue.phone_2 }} &lt;b&gt;email:&lt;/b&gt; {{item.email}} &lt;br&gt;
     {% endfor %}
  
    &lt;/form&gt;
   {% endfor %}
  {% endif %} 
  </code></pre>
  
  <p>I've also tried using the related name like this:</p>
  
  <pre><code>{% for item in issue.next_contact.all %}
  </code></pre>
  
  <p>What am I doing wrong?</p>