Add compatibility with relation field attribute changes in Django 1.9+.

Review Request #10266 — Created Oct. 23, 2018 and submitted

Information

Django Evolution
master
3f0ab0b...

Reviewers

Django 1.9 replaced Field.rel with Field.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 of get_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.

Description From Last Updated

F401 'django_evolution.compat.models.get_remote_field_model' imported but unused

reviewbotreviewbot

F401 'django_evolution.compat.models.get_remote_field' imported but unused

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (c6b16c9)