title: Django Regroup User ForeignKey
body: <p>I have the following model:</p>
  
  <pre><code>class JobView(models.Model):
      job = models.ForeignKey(Job)
      user = models.ForeignKey('auth.User')
      created = models.DateTimeField(auto_now_add=True)
      modified = models.DateTimeField(auto_now=True)
  
      class Meta:
          ordering = ['-created']
  </code></pre>
  
  <p>And in a view i'm grabbing the job info:</p>
  
  <pre><code>model = Job.objects.get(pk=id)
  </code></pre>
  
  <p>In a template I'm doing the following:</p>
  
  <pre><code>        {% regroup model.jobview_set.all by user as user_list %}
          {% for u in user_list %}
          {{ u.grouper.email }}
          {% endfor %}
  </code></pre>
  
  <p>The problem I'm having is that is not really grouping by the user, or more to the point, randomly grouping them by the user.. Sometimes it display the user twice, sometimes 3 times..Is there something I'm missing?</p>
  
  <p>Cheers!</p>