Deprecate support for registering a PluginTemplateExtension subclass via model (singular) #10025

Closed
opened 2025-12-29 21:25:54 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Jul 30, 2024).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

Deprecate support for the singular model attribute on PluginTemplateExtension. Subclasses will need to update accordingly:

Old

class MyExtension(PluginTemplateExtension):
    model = 'dcim.site'

New

class MyExtension(PluginTemplateExtension):
    models = ['dcim.site']

Justification

NetBox v4.1 introduced support for registering on one or more models via the new models (plural) attribute, which obsoleted the singular form.

Impact

PluginTemplateExtension subclasses which continue to register using the model attribute will generate a deprecation warning.

Originally created by @jeremystretch on GitHub (Jul 30, 2024). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes Deprecate support for the singular `model` attribute on `PluginTemplateExtension`. Subclasses will need to update accordingly: #### Old ```python class MyExtension(PluginTemplateExtension): model = 'dcim.site' ``` #### New ```python class MyExtension(PluginTemplateExtension): models = ['dcim.site'] ``` ### Justification NetBox v4.1 introduced support for registering on one or more models via the new `models` (plural) attribute, which obsoleted the singular form. ### Impact `PluginTemplateExtension` subclasses which continue to register using the `model` attribute will generate a deprecation warning.
adam added the status: acceptedtype: deprecation labels 2025-12-29 21:25:54 +01:00
adam closed this issue 2025-12-29 21:25:54 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10025