Django 1.10 support for FieldTracker #233
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #232
So two things going on here.
First, as of Django 1.8, we should be using
get_deferred_fields
rather than manually probing forisinstance(field_obj, DeferredAttribute)
.Second, as of Django 1.10, it seems inherited models don't pull through the deferred fields in
__class__.__dict__
. Have to consult the base class to get them. I have a feeling this might be a regression and will probs raise a ticket with django to make sure, but this bandaid should work for the time being. There's a slight niggle in that dj110 now supports overriding fields from the base class. I think I'm building the dict in the correct order so that stuff is overridden correctly, but there might need to be additional tests added to check for this (can open a new issue). Also, perhaps there's a way to get a hold of the deferred field that avoids the use of__class__.__dict__
altogether?Tests all pass now so removed dj110 from allowed failures.