Add and fix utility functions for working with apps and models.
Review Request #10551 — Created May 13, 2019 and updated
This introduces and reworks some utility functions for retrieving or
parsing information on apps.
retrieve their informatoin from the
AppConfigon Django 1.7+, and the
AppConfigcan now be retrieved through
old legacy version of the label can be returned using
At the moment, this will return some incompatible information for apps
when using a new-style app label on modern versions of Django, but this
wasn't expected to work yet anyway.
Model fetching also has fixes on Django 1.7+. It no longer assumes
anything about the provided app module's label, and instead loops
through apps looking for one that owns the provided module.
These will be needed for the app label support coming in the next
Unit tests pass on Django 1.6. This change temporarily breaks them on
Seems like this could use your new get_app_config_for_app helper.