Introduce a clone() method on NetBoxModel #9414
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.2.3
Feature type
New functionality
Proposed functionality
Add a
clone()
method to the base NetBoxModel class (or a new mixin) to replace the current approach of definingclone_fields
on a model. This will return a dictionary of field names mapped to values to be used in the creation of a cloned object. Document this method as a supported component for plugins.Use case
The switch from a static list of fields to a method allows us to apply arbitrary logic when determining the values for the cloned object. For example, when cloning an IP address, we can automatically calculate the next available address (#8171).
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: