mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
Fixed #10199 -- Modified aggregate() calls to clone the base query so that the base query can be reused. Thanks to Alex Gaynor for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -307,11 +307,13 @@ class QuerySet(object):
|
||||
for arg in args:
|
||||
kwargs[arg.default_alias] = arg
|
||||
|
||||
query = self.query.clone()
|
||||
|
||||
for (alias, aggregate_expr) in kwargs.items():
|
||||
self.query.add_aggregate(aggregate_expr, self.model, alias,
|
||||
query.add_aggregate(aggregate_expr, self.model, alias,
|
||||
is_summary=True)
|
||||
|
||||
return self.query.get_aggregation()
|
||||
return query.get_aggregation()
|
||||
|
||||
def count(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user