Attempt to address Django 2.0 deprecate warnings related to field.rel#3906
Closed
jplock wants to merge 3 commits intoencode:masterfrom
Closed
Attempt to address Django 2.0 deprecate warnings related to field.rel#3906jplock wants to merge 3 commits intoencode:masterfrom
jplock wants to merge 3 commits intoencode:masterfrom
Conversation
Contributor
|
Thanks for the PR. Unfortunately this breaks Django < 1.9 compatibility. |
Author
|
@xordoquy thanks for the feedback, I added a compatibility function and the tests are now passing. |
| while get_remote_field(pk) and get_remote_field(pk).parent_link: | ||
| # If model is a child via multi-table inheritance, use parent's pk. | ||
| pk = pk.rel.to._meta.pk | ||
| pk = get_remote_field(pk).to._meta.pk |
Contributor
There was a problem hiding this comment.
Could we instead have this set in a var after line 83? remote_field = get_remote_field(pk) and use throughout?
… want to see what Travis says
Contributor
|
Looks like this just needs bringing up to date with master. |
Contributor
|
Thanks for raising this @jplock. Now resolved! |
Author
|
Thanks for fixing this. Once I tried to implement @jpadilla's suggestion, I got stuck and distracted. |
Contributor
|
S'all good. We got there in the end! |
This was referenced Mar 9, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is related to django/django#4241
I'm not sure how best to handle this for versions prior to Django 1.9