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

Remove csv_headers model attributes

This commit is contained in:
jeremystretch
2021-06-09 15:52:49 -04:00
parent 578885225f
commit 7e18b0dd3a
23 changed files with 78 additions and 169 deletions

View File

@ -43,7 +43,7 @@ class ClusterTypeCSVForm(CustomFieldModelCSVForm):
class Meta:
model = ClusterType
fields = ClusterType.csv_headers
fields = ('name', 'slug', 'description')
class ClusterTypeBulkEditForm(BootstrapMixin, CustomFieldBulkEditForm):
@ -79,7 +79,7 @@ class ClusterGroupCSVForm(CustomFieldModelCSVForm):
class Meta:
model = ClusterGroup
fields = ClusterGroup.csv_headers
fields = ('name', 'slug', 'description')
class ClusterGroupBulkEditForm(BootstrapMixin, CustomFieldBulkEditForm):
@ -174,7 +174,7 @@ class ClusterCSVForm(CustomFieldModelCSVForm):
class Meta:
model = Cluster
fields = Cluster.csv_headers
fields = ('name', 'type', 'group', 'site', 'comments')
class ClusterBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEditForm):
@ -468,7 +468,9 @@ class VirtualMachineCSVForm(CustomFieldModelCSVForm):
class Meta:
model = VirtualMachine
fields = VirtualMachine.csv_headers
fields = (
'name', 'status', 'role', 'cluster', 'tenant', 'platform', 'vcpus', 'memory', 'disk', 'comments',
)
class VirtualMachineBulkEditForm(BootstrapMixin, AddRemoveTagsForm, CustomFieldBulkEditForm):
@ -735,7 +737,9 @@ class VMInterfaceCSVForm(CSVModelForm):
class Meta:
model = VMInterface
fields = VMInterface.csv_headers
fields = (
'virtual_machine', 'name', 'enabled', 'mac_address', 'mtu', 'description', 'mode',
)
def clean_enabled(self):
# Make sure enabled is True when it's not included in the uploaded data