title: Django annotation and GROUP BY
body: <p>I am having trouble with making a query in django. Following is my model class:</p>
  
  <pre><code>class Registration(models.Model):
      event_type = models.CharField(max_length=80)
      date_time = models.DateField()
      total_assessment = models.IntegerField()
  </code></pre>
  
  <p>I want to: </p>
  
  <pre><code>SELECT event_type, SUM(total_assessment) as count 
  from Registration
  WHERE event_type in ('value1', 'value2', 'value3')
  GROUP BY event_type
  </code></pre>
  
  <p>How can I translate this query to Django ORM.</p>
  
  <p>I found this to be working for me: </p>
  
  <pre><code>Registration.objects.values('event_type').annotate(Sum('count')).filter(event_type__in=['VHRAssmntCompleted', 'VNAAssmntCompleted', 'PapSmear'])
  </code></pre>
  
  <p>Is there a better solution?</p>