mirror of
https://github.com/django/django.git
synced 2025-09-24 19:23:03 +00:00
Refs #11256 -- Extended the annotation field name conflict check to cover m2ms and reverse related descriptors as well. This is needed to actually cover the case raised by #14373.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14116 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ace6519fae
commit
2f17dd3dd0
2 changed files with 9 additions and 1 deletions
|
@ -625,7 +625,7 @@ class QuerySet(object):
|
|||
% arg.default_alias)
|
||||
kwargs[arg.default_alias] = arg
|
||||
|
||||
names = set([f.name for f in self.model._meta.fields])
|
||||
names = set(self.model._meta.get_all_field_names())
|
||||
for aggregate in kwargs:
|
||||
if aggregate in names:
|
||||
raise ValueError("The %s annotation conflicts with a field on "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue