mirror of
https://github.com/django/django.git
synced 2025-12-02 00:01:29 +00:00
Fixed #20782 -- qs.values().aggregate() failure
In the combination of .values().aggregate() the aggregate_select_mask didn't include the aggregates added. This resulted in bogus query. Thanks to Trac alias debanshuk for report.
This commit is contained in:
parent
29a09b3638
commit
4bd5554721
3 changed files with 19 additions and 1 deletions
|
|
@ -1753,6 +1753,10 @@ class Query(object):
|
|||
self.aggregate_select_mask = set(names)
|
||||
self._aggregate_select_cache = None
|
||||
|
||||
def append_aggregate_mask(self, names):
|
||||
if self.aggregate_select_mask is not None:
|
||||
self.set_aggregate_mask(set(names).union(self.aggregate_select_mask))
|
||||
|
||||
def set_extra_mask(self, names):
|
||||
"""
|
||||
Set the mask of extra select items that will be returned by SELECT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue