title: Django orm get latest for each group
body: <p>I am using Django 1.6 with Mysql.</p>
  
  <p>I have these models:</p>
  
  <pre><code>class Student(models.Model):
       username = models.CharField(max_length=200, unique = True)
  
  class Score(models.Model)
       student = models.ForeignKey(Student)
       date = models.DateTimeField()
       score = models.IntegerField()
  </code></pre>
  
  <p>I want to get the latest score record for each student.<br>
  I have tried:</p>
  
  <pre><code>Score.objects.values('student').annotate(latest_date=Max('date'))
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>Score.objects.values('student__username').annotate(latest_date=Max('date'))
  </code></pre>
  
  <p>as described <a href="https://stackoverflow.com/questions/17887075/django-orm-get-latest-record-for-group">Django ORM - Get the latest record for the group</a>
  but it did not help.</p>