title: Can Django's .annotate() return objects?
body: <p>I have a record set that looks like this (extraneous data omitted to protect the easily bored):</p>
  
  <pre><code> id | user_id |            created            | units
  ----+---------+-------------------------------+-------
    1 |       1 | 2011-04-18 15:43:02.737063+00 |    20
    2 |       1 | 2011-04-18 15:43:02.737063+00 |     4
    3 |       1 | 2011-04-18 15:46:48.592999+00 |    -1
    4 |       1 | 2011-04-19 12:02:10.687587+00 |    -1
    5 |       1 | 2011-04-19 12:09:20.039543+00 |    -1
    6 |       1 | 2011-04-19 12:11:21.948494+00 |    -1
    7 |       1 | 2011-04-19 12:15:51.544394+00 |    -1
    8 |       1 | 2011-04-19 12:16:44.623655+00 |    -1
  </code></pre>
  
  <p>And I'd like to get a result that looks like this:</p>
  
  <pre><code> id | user_id |            created            | units
  ----+---------+-------------------------------+-------
    8 |       1 | 2011-04-19 12:16:44.623655+00 |    14
    2 |       1 | 2011-04-18 15:43:02.737063+00 |     4
  </code></pre>
  
  <p>So I naturally look to <code>.annotate()</code>:</p>
  
  <pre><code>u = User.objects.get(pk=1)
  (MyModel.objects.filter(user=u)
          .values("id","user","created")
          .annotate(stuff=Sum("units"))
  )
  </code></pre>
  
  <p>The problem is that I want <strong>objects</strong>, not a single list of dictionaries.  I need the methods attached to those objects to be available.  Any ideas as to how to do this?</p>
  
  <p><strong>Edit</strong>:
  I should have pointed out that I tried using .values() because without it I would get a bunch of annotated objects alright, but there would be 8 of them (as in the first query above), and not 2 (as in the second result above).  My guess is that it's not combining the rows because there's a timestamp in there making the rows different:</p>
  
  <pre><code>MyModel.objects.filter(user=u).annotate(Sum("units"))
  # Returns 8 records, not 2 as expected
  </code></pre>