mirror of
https://github.com/django/django.git
synced 2025-09-27 04:29:17 +00:00
Fixed #11789 -- Fixed aggregates so it interacts with QuerySet none() in a way consistent with other empty query sets. Thanks alexr for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16254 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
f60d428463
commit
a8598c7de2
2 changed files with 15 additions and 0 deletions
|
@ -1132,6 +1132,14 @@ class EmptyQuerySet(QuerySet):
|
|||
"""
|
||||
return 0
|
||||
|
||||
def aggregate(self, *args, **kwargs):
|
||||
"""
|
||||
Return a dict mapping the aggregate names to None
|
||||
"""
|
||||
for arg in args:
|
||||
kwargs[arg.default_alias] = arg
|
||||
return dict([(key, None) for key in kwargs])
|
||||
|
||||
# EmptyQuerySet is always an empty result in where-clauses (and similar
|
||||
# situations).
|
||||
value_annotation = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue