|
@@ -2236,6 +2236,12 @@ class BaseDeviceCSVForm(CustomFieldModelCSVForm):
|
|
|
choices=DeviceStatusChoices,
|
|
choices=DeviceStatusChoices,
|
|
|
help_text='Operational status'
|
|
help_text='Operational status'
|
|
|
)
|
|
)
|
|
|
|
|
+ virtual_chassis = CSVModelChoiceField(
|
|
|
|
|
+ queryset=VirtualChassis.objects.all(),
|
|
|
|
|
+ to_field_name='name',
|
|
|
|
|
+ required=False,
|
|
|
|
|
+ help_text='Virtual chassis'
|
|
|
|
|
+ )
|
|
|
cluster = CSVModelChoiceField(
|
|
cluster = CSVModelChoiceField(
|
|
|
queryset=Cluster.objects.all(),
|
|
queryset=Cluster.objects.all(),
|
|
|
to_field_name='name',
|
|
to_field_name='name',
|
|
@@ -2246,6 +2252,10 @@ class BaseDeviceCSVForm(CustomFieldModelCSVForm):
|
|
|
class Meta:
|
|
class Meta:
|
|
|
fields = []
|
|
fields = []
|
|
|
model = Device
|
|
model = Device
|
|
|
|
|
+ help_texts = {
|
|
|
|
|
+ 'vc_position': 'Virtual chassis position',
|
|
|
|
|
+ 'vc_priority': 'Virtual chassis priority',
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
def __init__(self, data=None, *args, **kwargs):
|
|
def __init__(self, data=None, *args, **kwargs):
|
|
|
super().__init__(data, *args, **kwargs)
|
|
super().__init__(data, *args, **kwargs)
|
|
@@ -2284,7 +2294,8 @@ class DeviceCSVForm(BaseDeviceCSVForm):
|
|
|
class Meta(BaseDeviceCSVForm.Meta):
|
|
class Meta(BaseDeviceCSVForm.Meta):
|
|
|
fields = [
|
|
fields = [
|
|
|
'name', 'device_role', 'tenant', 'manufacturer', 'device_type', 'platform', 'serial', 'asset_tag', 'status',
|
|
'name', 'device_role', 'tenant', 'manufacturer', 'device_type', 'platform', 'serial', 'asset_tag', 'status',
|
|
|
- 'site', 'location', 'rack', 'position', 'face', 'cluster', 'comments',
|
|
|
|
|
|
|
+ 'site', 'location', 'rack', 'position', 'face', 'virtual_chassis', 'vc_position', 'vc_priority', 'cluster',
|
|
|
|
|
+ 'comments',
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
def __init__(self, data=None, *args, **kwargs):
|
|
def __init__(self, data=None, *args, **kwargs):
|
|
@@ -2319,7 +2330,7 @@ class ChildDeviceCSVForm(BaseDeviceCSVForm):
|
|
|
class Meta(BaseDeviceCSVForm.Meta):
|
|
class Meta(BaseDeviceCSVForm.Meta):
|
|
|
fields = [
|
|
fields = [
|
|
|
'name', 'device_role', 'tenant', 'manufacturer', 'device_type', 'platform', 'serial', 'asset_tag', 'status',
|
|
'name', 'device_role', 'tenant', 'manufacturer', 'device_type', 'platform', 'serial', 'asset_tag', 'status',
|
|
|
- 'parent', 'device_bay', 'cluster', 'comments',
|
|
|
|
|
|
|
+ 'parent', 'device_bay', 'virtual_chassis', 'vc_position', 'vc_priority', 'cluster', 'comments',
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
def __init__(self, data=None, *args, **kwargs):
|
|
def __init__(self, data=None, *args, **kwargs):
|