Fixed #12608 -- No longer return inconsistent results when using values and values_list in conjunction with annotate. Thanks, Charlie Leifer.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12505 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Justin Bronn 2010-02-23 05:26:49 +00:00
parent c4699b0b8a
commit 5546430304
3 changed files with 6 additions and 1 deletions

View file

@ -954,7 +954,8 @@ class ValuesListQuerySet(ValuesQuerySet):
# If a field list has been specified, use it. Otherwise, use the
# full list of fields, including extras and aggregates.
if self._fields:
fields = self._fields
fields = list(self._fields) + filter(lambda f: f not in self._fields,
aggregate_names)
else:
fields = names