#12608: Inconsistent results from values and values_list when using annotate
---------------------------+------------------------------------------------
Reporter: mattmcc | Owner: nobody
Status: new | Milestone: 1.2
Component: Uncategorized | Version: SVN
Keywords: | Stage: Unreviewed
Has_patch: 0 |
---------------------------+------------------------------------------------
To group users by email and get a count, one might do:
{{{
>>> User.objects.values('email').annotate(Count('email'))
[{'email__count': 2, 'email': u'[email protected]'}]
}}}
However, values_list discards the annotated value:
{{{
>>> User.objects.values_list('email').annotate(Count('email'))
[(u'[email protected]',)]
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/12608>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.