mirror of
https://github.com/django/django.git
synced 2025-09-09 20:16:32 +00:00
Fixed #10182 -- Corrected realiasing and the process of evaluating values() for queries with aggregate clauses. This means that aggregate queries can now be used as subqueries (such as in an __in clause). Thanks to omat for the report.
This involves a slight change to the interaction of annotate() and values() clauses that specify a list of columns. See the docs for details. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9888 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4bd24474c0
commit
542709d0d1
7 changed files with 102 additions and 32 deletions
|
@ -46,7 +46,7 @@ class Aggregate(object):
|
|||
# Validate that the backend has a fully supported, correct
|
||||
# implementation of this aggregate
|
||||
query.connection.ops.check_aggregate_support(aggregate)
|
||||
query.aggregate_select[alias] = aggregate
|
||||
query.aggregates[alias] = aggregate
|
||||
|
||||
class Avg(Aggregate):
|
||||
name = 'Avg'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue