title: Django ORM group by
body: <p>I have the following model.</p>
  
  <pre><code>Class A(models.Model):
      tmp_field = models.IntegerField()
      ...
      ...
  </code></pre>
  
  <p>Now I want to fetch only <code>id</code>s and group them together based on the <code>tmp</code> field.</p>
  
  <p>My query looks like</p>
  
  <pre><code>A.objects.all().values('id')
  </code></pre>
  
  <p>So I want something like this. </p>
  
  <pre><code>[
      {tmp1: [id1, id2, id3]},
      {tmp2: [id5, id6, id7]},
      {tmp3: [id12, id213, id1299]}
      ...
  ]
  </code></pre>
  
  <p>How do I group them by <code>tmp_field</code>.</p>