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

Add bridge field to Interface, VMInterface models

This commit is contained in:
jeremystretch
2021-10-21 16:30:18 -04:00
parent a3e7cab935
commit e1e2c76ae1
25 changed files with 260 additions and 119 deletions

View File

@@ -104,6 +104,18 @@ class VMInterfaceCSVForm(CustomFieldModelCSVForm):
queryset=VirtualMachine.objects.all(),
to_field_name='name'
)
parent = CSVModelChoiceField(
queryset=VMInterface.objects.all(),
required=False,
to_field_name='name',
help_text='Parent interface'
)
bridge = CSVModelChoiceField(
queryset=VMInterface.objects.all(),
required=False,
to_field_name='name',
help_text='Bridged interface'
)
mode = CSVChoiceField(
choices=InterfaceModeChoices,
required=False,
@@ -113,7 +125,7 @@ class VMInterfaceCSVForm(CustomFieldModelCSVForm):
class Meta:
model = VMInterface
fields = (
'virtual_machine', 'name', 'enabled', 'mac_address', 'mtu', 'description', 'mode',
'virtual_machine', 'name', 'parent', 'bridge', 'enabled', 'mac_address', 'mtu', 'description', 'mode',
)
def clean_enabled(self):