Fixed #16409 -- Fixed an error condition when using QuerySet only()/defer() on the result of an annotate() call. Thanks jaklaassen AT gmail DOT com and Tai Lee for the reports and Tai for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16522 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ramiro Morales 2011-07-07 01:12:45 +00:00
parent f5c9c2246e
commit b2050ff546
3 changed files with 9 additions and 4 deletions

View file

@ -169,7 +169,7 @@ class SQLCompiler(object):
if isinstance(col, (list, tuple)):
alias, column = col
table = self.query.alias_map[alias][TABLE_NAME]
if table in only_load and col not in only_load[table]:
if table in only_load and column not in only_load[table]:
continue
r = '%s.%s' % (qn(alias), qn(column))
if with_aliases: