Add compatibility with relation field attribute changes in Django 1.9+.
Review Request #10266 — Created Oct. 23, 2018 and submitted — Latest diff uploaded
Django 1.9 replaced
Field.rel
withField.remote_field
, along with a
handful of other attributes, as part of an effort to provide a
supported, documented API for field relations.This change adds compatibility with both the old undocumented API and
the new documented API through the addition ofget_remote_field()
and
get_remote_field_model()
functions. These are used instead of
.rel
/.rel.to
and.remote_field
/.remote_field.model
accessors.
Unit tests pass on Django 1.6 through 1.11, and 2.1 with additional
changes.
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/mock_models.py |
---|
django_evolution/signature.py |
---|
django_evolution/compat/db.py |
---|
django_evolution/compat/models.py |
---|
django_evolution/db/common.py |
---|
django_evolution/db/mysql.py |
---|
django_evolution/db/sqlite3.py |
---|
django_evolution/tests/utils.py |
---|