title: DJANGO: Showing many-to-many additional fields in template
body: <p>I have the following situation: A project can belong to multiple departments, Employees are assigned roles to multiple projects. How do I show the roles field in a template? employees.role shows blank...</p>
  
  <p>MODELS</p>
  
  <pre><code>class Projects(models.Model):
      name = models.CharField(max_length=20)
  
  class Department(models.Model):
      name = models.CharField(max_length=20)
  
  class Employees(models.Model):
      fname = models.CharField(max_length=15)
  
  class Departmentprojects(models.Model):
      department = models.ForeignKey(Department)
      projects = models.ForeignKey(Projects)
      members = models.ManyToManyField(Employee, through='Membership')
  
  class Membership(models.Model):
      departmentprojects = models.ForeignKey(Departmentprojects)
      employee = models.ForeignKey(Employee)
      role = models.CharField(max_length=20) #i want to show this field in a template
  </code></pre>
  
  <p>VIEW</p>
  
  <pre><code>def department_detail(request, company_id):
  department = get_object_or_404(Department, pk=department_id)
  return render_to_response('test/detail.html', {'department': department})
  </code></pre>
  
  <p>TEMPLATE</p>
  
  <pre><code>&lt;h1&gt;{{ department.name }}&lt;/h1&gt;
  
  {% for projects in department.departmentprojects_set.all %}
      &lt;h2&gt;{{ projects.projects }}&lt;/h2&gt;
          &lt;ul&gt;
              {% for employees in projects.members.all %}
                  &lt;li&gt;{{ employee }} | {{ employee.role }}&lt;/li&gt;
              {% endfor %}
          &lt;/ul&gt;
  {% endfor %}
  </code></pre>