mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
Fixed #15790 -- Fixed QuerySet only() and defer() methods behavior with proxy models. Thanks Michal Modzelewzki for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -553,7 +553,10 @@ class Query(object):
|
||||
columns = set()
|
||||
orig_opts = self.model._meta
|
||||
seen = {}
|
||||
must_include = {self.model: set([orig_opts.pk])}
|
||||
if orig_opts.proxy:
|
||||
must_include = {orig_opts.proxy_for_model: set([orig_opts.pk])}
|
||||
else:
|
||||
must_include = {self.model: set([orig_opts.pk])}
|
||||
for field_name in field_names:
|
||||
parts = field_name.split(LOOKUP_SEP)
|
||||
cur_model = self.model
|
||||
|
||||
Reference in New Issue
Block a user