Skip to content

Commit a2c7452

Browse files
arthansonjeremystretch
authored andcommitted
12058 add clone to config context
1 parent 654e32c commit a2c7452

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

netbox/extras/models/configcontexts.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from extras.querysets import ConfigContextQuerySet
77
from netbox.models import ChangeLoggedModel
8-
from netbox.models.features import WebhooksMixin
8+
from netbox.models.features import CloningMixin, WebhooksMixin
99
from utilities.utils import deepmerge
1010

1111

@@ -19,7 +19,7 @@
1919
# Config contexts
2020
#
2121

22-
class ConfigContext(WebhooksMixin, ChangeLoggedModel):
22+
class ConfigContext(CloningMixin, WebhooksMixin, ChangeLoggedModel):
2323
"""
2424
A ConfigContext represents a set of arbitrary data available to any Device or VirtualMachine matching its assigned
2525
qualifiers (region, site, etc.). For example, the data stored in a ConfigContext assigned to site A and tenant B
@@ -108,6 +108,12 @@ class ConfigContext(WebhooksMixin, ChangeLoggedModel):
108108

109109
objects = ConfigContextQuerySet.as_manager()
110110

111+
clone_fields = (
112+
'weight', 'is_active', 'regions', 'site_groups', 'sites', 'locations', 'device_types',
113+
'roles', 'platforms', 'cluster_types', 'cluster_groups', 'clusters', 'tenant_groups',
114+
'tenants', 'tags', 'data',
115+
)
116+
111117
class Meta:
112118
ordering = ['weight', 'name']
113119

0 commit comments

Comments
 (0)