title: django count per column
body: <p>I have a ORM like this</p>
  
  <pre><code>from django.db import models,
  
  class MyObject(models.Model):
  
     class Meta:
         db_table = 'myobject'
  
     id = models.IntegerField(primary_key=True)
     name = models.CharField(max_length=48)                                        
     status = models.CharField(max_length=48)                          
  </code></pre>
  
  <p>Imagine I have the following entries</p>
  
  <pre><code>1 | foo | completed
  2 | foo | completed
  3 | bar | completed
  4 | foo | failed
  </code></pre>
  
  <p>What is the django ORM query that I have to make in order to get a queryset somewhat like the following</p>
  
  <pre><code>[{'name': 'foo', 'status_count': 'completed: 2, failed: 1'},
   {'name': 'bar', 'status_count': 'completed: 1'}]
  </code></pre>
  
  <p>I started with the following but I don't know how to "merge" the two columns:</p>
  
  <pre><code>from django.db.models import Count
  models.MyObject.objects.values(
      'name',
      'status'
  ).annotate(my_count=Count('id'))
  </code></pre>
  
  <p>The goal of all this to get a table where I can show something like the following:</p>
  
  <pre><code>Name | completed | failed
  foo  | 2         | 1
  bar  | 1         | 0
  </code></pre>