mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
Fixed #12851 -- Another attempt at fixing select_related() with inherited models, this time with only(). Thanks to phxx for the test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13059 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -556,10 +556,10 @@ class Query(object):
|
||||
# models.
|
||||
workset = {}
|
||||
for model, values in seen.iteritems():
|
||||
for field in model._meta.fields:
|
||||
for field, m in model._meta.get_fields_with_model():
|
||||
if field in values:
|
||||
continue
|
||||
add_to_dict(workset, model, field)
|
||||
add_to_dict(workset, m or model, field)
|
||||
for model, values in must_include.iteritems():
|
||||
# If we haven't included a model in workset, we don't add the
|
||||
# corresponding must_include fields for that model, since an
|
||||
|
||||
Reference in New Issue
Block a user