1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #33: Add ability to clone objects (pre-populate form fields)

This commit is contained in:
Jeremy Stretch
2019-12-06 16:13:52 -05:00
parent 47fefbec07
commit 446acbdf82
23 changed files with 186 additions and 34 deletions

View File

@@ -129,6 +129,9 @@ class Cluster(ChangeLoggedModel, CustomFieldModel):
tags = TaggableManager(through=TaggedItem)
csv_headers = ['name', 'type', 'group', 'site', 'comments']
clone_fields = [
'type', 'group', 'tenant', 'site',
]
class Meta:
ordering = ['name']
@@ -252,6 +255,9 @@ class VirtualMachine(ChangeLoggedModel, ConfigContextModel, CustomFieldModel):
csv_headers = [
'name', 'status', 'role', 'cluster', 'tenant', 'platform', 'vcpus', 'memory', 'disk', 'comments',
]
clone_fields = [
'cluster', 'tenant', 'platform', 'status', 'role', 'vcpus', 'memory', 'disk',
]
STATUS_CLASS_MAP = {
'active': 'success',