-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtopic: pluginsRelates to the plugins frameworkRelates to the plugins frameworktype: featureIntroduction of new functionality to the applicationIntroduction of new functionality to the application
Milestone
Description
NetBox version
v4.0.6
Feature type
New functionality
Proposed functionality
A subclass of PluginTemplateExtension must currently register against a single model. For example:
from netbox.plugins import PluginTemplateExtension
class SiteCustomContent(PluginTemplateExtension):
model = 'dcim.site'This issue proposes adding an alternative models attribute to specify an iterable of models. For example:
from netbox.plugins import PluginTemplateExtension
class SiteCustomContent(PluginTemplateExtension):
models = ['dcim.region', 'dcim.site', 'dcim.location']The content introduced by this class will then be embedded on the relevant view for each of the listed models.
If models is defined, it will take precedence over model.
Use case
This obviates the need to create a redundant PluginTemplateExtension subclass for each core model.
Database changes
None
External dependencies
None
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtopic: pluginsRelates to the plugins frameworkRelates to the plugins frameworktype: featureIntroduction of new functionality to the applicationIntroduction of new functionality to the application