Support the use of NetBox features by plugin models #8392
Labels
status: accepted
This issue has been accepted for implementation
topic: plugins
Relates to the plugins framework
type: feature
Introduction of new functionality to the application
Milestone
NetBox version
v3.1.6
Feature type
New functionality
Proposed functionality
Officially support the use of various NetBox features by plugin models. These include:
For each feature above, we should introduce (or repurpose) a class which a model can inherit to enable the feature. For example, a TagsMixin class would enable the assignment of tags, and a CustomLinksMixin would enable custom links.
In the interest of cleanliness, we probably also want to introduce a base model class (e.g. BaseModel) that inherits all such feature mixins. A plugin model can then simply inherit from BaseModel to enable all features (while reserving the option to inherit only specific mixin classes if only a subset of features is desired).
I'd like to do away with the
extras_features()
decorator that's currently used to register features for specific models, as it's redundant for features which require additional fields or attributes on the model (see #8373). We may be able to leverage Django'sclass_prepared
signal to automate this process.Use case
This initiative will enable plugin authors to make use of many valuable features built into NetBox in a convenient and supported way.
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: