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

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

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.

Summary ID
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
Description From Last Updated

E501 line too long (80 > 79 characters)

reviewbotreviewbot

E303 too many blank lines (3)

reviewbotreviewbot

E501 line too long (82 > 79 characters)

reviewbotreviewbot

E501 line too long (80 > 79 characters)

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 release-2.x (d14b9b3)