Skip to content

Conversation

@jk-ozlabs
Copy link
Contributor

Previously, deferring on multiple fields (in different classes) did not
properly omit the superclass' defered field; we were iterating the
fields from SubClass._meta.fields as well as SuperClass._meta.fields,
and only deferred one of those.

Changed to iterate .local_fields only, so we do the correct filtering.

Thanks to Simon Charette for the suggested fix.

@jk-ozlabs
Copy link
Contributor Author

Since this is a trivial patch (and my first), I've not added to AUTHORS or submitted a CLA. Let me know if I need to do either of those.

@timgraham timgraham changed the title Fixed #28549 - only iterate .local_fields during defer workset creation Fixed #28549 -- Fixed QuerySet.defer() with super and subclass fields. Aug 31, 2017
Previously, deferring fields in different classes didn't omit the
superclass' deferred field.

Thanks Simon Charette for the suggested fix.
@timgraham timgraham merged commit 84b7cb7 into django:master Aug 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants