Change field type checks to work with subclasses.
Review Request #10298 — Created Nov. 1, 2018 and submitted — Latest diff uploaded
There's a large number of legacy
if type is ...
checks throughout the
codebase, which limits functionality to those specific field types.
While rare, any subclasses of these field types (such asForeignKey
)
would result in broken or inconsistent behavior.This change updates all these to use
issubclass
orisinstance
instead of direct type checks.
Unit tests pass on all supported versions of Django.
Diff Revision 1
This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.
orig
1
2
django_evolution/diff.py |
---|
django_evolution/mock_models.py |
---|
django_evolution/mutations.py |
---|