Replace import_object() with Django's import_string() #7129

Closed
opened 2025-12-29 20:19:32 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Oct 19, 2022).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

extras.plugins.utils defines a custom import_object() function, which is used to dynamically import modules specified by a string. This can be removed and replaced with Django's own import_string() function.

Although this is not a documented part of the plugins API, we should bind this to a minor release to avoid any surprises for plugin authors who opted to use it.

Justification

Eliminates unnecessary code and leverages a Django utility.

Originally created by @jeremystretch on GitHub (Oct 19, 2022). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes `extras.plugins.utils` defines a custom `import_object()` function, which is used to dynamically import modules specified by a string. This can be removed and replaced with Django's own [`import_string()`](https://docs.djangoproject.com/en/4.1/ref/utils/#django.utils.module_loading.import_string) function. Although this is not a documented part of the plugins API, we should bind this to a minor release to avoid any surprises for plugin authors who opted to use it. ### Justification Eliminates unnecessary code and leverages a Django utility.
adam added the status: acceptedtype: deprecation labels 2025-12-29 20:19:32 +01:00
adam closed this issue 2025-12-29 20:19:32 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7129