Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Introduce a clone() method on NetBoxModel #9414

Closed
jeremystretch opened this issue May 24, 2022 · 0 comments
Closed

Introduce a clone() method on NetBoxModel #9414

jeremystretch opened this issue May 24, 2022 · 0 comments
Assignees
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

Comments

@jeremystretch
Copy link
Member

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 defining clone_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

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application labels May 24, 2022
@jeremystretch jeremystretch added this to the v3.3 milestone May 24, 2022
@jeremystretch jeremystretch added the topic: plugins Relates to the plugins framework label Jun 2, 2022
@jeremystretch jeremystretch self-assigned this Jun 23, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
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
Projects
None yet
Development

No branches or pull requests

1 participant