Skip to content
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.

Fixes for python3 #28

Merged
merged 2 commits into from
Nov 21, 2018
Merged

Fixes for python3 #28

merged 2 commits into from
Nov 21, 2018

Conversation

dandavison
Copy link
Contributor

Updates the test suite to test Python 3.7 in addition to 2.7, and makes the few changes necessary to get the tests to pass on both (plus a __str__/__unicode__ magic method change which the tests don't address).

@@ -572,7 +571,7 @@ def _find_relations(self, node, depth=0):
# NOTE: the many-to-many relations are evaluated first to prevent
# 'through' models being bound as a ForeignKey relationship.
fields = sorted(model._meta.get_fields(), reverse=True,
key=lambda f: f.many_to_many)
key=lambda f: bool(f.many_to_many))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will no longer sort None and False separately, but I believe that it maintains correct behavior.

Signed-off-by: Dan Davison <dandavison7@gmail.com>
Signed-off-by: Dan Davison <dandavison7@gmail.com>
@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 76.182% when pulling 166aa9e on dandavison:python-3 into 94a8516 on chop-dbhi:master.

@naegelyd
Copy link
Collaborator

These changes LGTM. Will defer to @bruth to merge.

@naegelyd naegelyd requested a review from bruth November 21, 2018 17:59
@bruth bruth merged commit 88c7ab0 into chop-dbhi:master Nov 21, 2018
@dandavison dandavison deleted the python-3 branch November 21, 2018 18:27
@naegelyd naegelyd mentioned this pull request Nov 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants