Add and update compatibility functions for working with models and fields.

Review Request #12229 — Created April 8, 2022 and submitted — Latest diff uploaded

Information

Django Evolution
release-2.x

Reviewers

This introduces three new compatibility functions for working with fields
cross-Django:

  • get_field_is_relation()
  • get_field_is_many_to_many()
  • get_remote_field_related_model()

It also updates several other field-relation functions to provide more
consistent results for different fiels and relation types.

Unit tests were added for most functions in this module to help catch
inconsistencies in behavior across versions of Django.

Unit tests pass on all supported versions of Django.

Used the new behavior in some in-progress changes.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Add and update compatibility functions for working with models and fields.
This introduces three new compatibility functions for working with fields cross-Django: * `get_field_is_relation()` * `get_field_is_many_to_many()` * `get_remote_field_related_model()` It also updates several other field-relation functions to provide more consistent results for different fiels and relation types. Unit tests were added for most functions in this module to help catch inconsistencies in behavior across versions of Django.
7b72e0bbe20db49b68b1225e280754709ffbff37 Christian Hammond
django_evolution/compat/db.py
django_evolution/compat/models.py
django_evolution/tests/test_compat_models.py
Loading...