Add configuration for renamed field module paths.
Review Request #13698 — Created April 4, 2024 and submitted
In some cases, field classes may be renamed or moved to different
modules. django-evolution had some one-off logic to handle this for when
django itself moved all the fields fromdjango.db.models.fields
to
django.db.models
, but there was nothing available to consumers of the
library to do the same.We recently ran into a problem where we decided to remove a dependency
on a third-party field, replacing it with a compatible home-grown
implementation. This worked fine, except django-evolution would fail to
load the signature because the old module didn't exist. This change adds
a new mapping to the django-evolution configuration,
RENAMED_FIELD_TYPES
, which allows a project to define their own
renames.
- Used this in conjunction with code that set
DJANGO_EVOLUTION['RENAMED_FIELD_TYPES']
to a mapping from our old
third-party library to our new implementation, and saw that
django-evolution management commands andEvolver
calls worked
correctly. - Ran unit tests.
Summary | ID |
---|---|
c98f7b06e3193b1c95b74a0215d30a0ce2af04c6 |
Description | From | Last Updated |
---|---|---|
This needs a Version Added. |
chipx86 |