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 1

This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.

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.
cefb8975b48c04220b5a79fe08a7342385810386 Christian Hammond
django_evolution/compat/db.py
django_evolution/compat/models.py
django_evolution/tests/test_compat_models.py
Loading...