mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
Fixed #10766 -- Raise an error when annotate() references another aggreagte(). Thanks to aseering@mit.edu for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10521 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1403,6 +1403,9 @@ class BaseQuery(object):
|
||||
field_name = field_list[0]
|
||||
col = field_name
|
||||
source = self.aggregates[field_name]
|
||||
if not is_summary:
|
||||
raise FieldError("Cannot compute %s('%s'): '%s' is an aggregate" % (
|
||||
aggregate.name, field_name, field_name))
|
||||
elif ((len(field_list) > 1) or
|
||||
(field_list[0] not in [i.name for i in opts.fields]) or
|
||||
self.group_by is None or
|
||||
|
||||
Reference in New Issue
Block a user