mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-07 08:08:15 -06:00
Add is_lag field and try to fix lag FlexibleModelChoice in InterfaceCSVForm
This commit is contained in:
parent
89b6aee205
commit
3fd2911bdc
@ -1543,7 +1543,7 @@ class InterfaceCSVForm(forms.ModelForm):
|
||||
)
|
||||
lag = FlexibleModelChoiceField(
|
||||
required=False,
|
||||
queryset = Interface.objects.order_naturally().filter(form_factor=IFACE_FF_LAG),
|
||||
queryset = Interface.objects.order_naturally(method=interface_ordering).filter(device=device,form_factor=IFACE_FF_LAG),
|
||||
help_text='Lag Name',
|
||||
error_messages={'invalid_choice': 'Lag not found.'}
|
||||
)
|
||||
@ -1579,10 +1579,14 @@ class InterfaceCSVForm(forms.ModelForm):
|
||||
required=False,
|
||||
help_text='Is Wireless?'
|
||||
)
|
||||
is_lag = forms.CharField(
|
||||
required=False,
|
||||
help_text='Is Lag?'
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = Interface
|
||||
fields = ('device', 'lag','name','mac_address','form_factor','enabled','description','mtu','mgmt_only','is_virtual','is_wireless')
|
||||
fields = ('device', 'lag','name','mac_address','form_factor','enabled','description','mtu','mgmt_only','is_virtual','is_wireless','is_lag')
|
||||
|
||||
|
||||
def clean_interface(self):
|
||||
|
@ -538,7 +538,7 @@ class InterfaceConnectionTable(BaseTable):
|
||||
class InterfaceImportTable(BaseTable):
|
||||
device = tables.LinkColumn('dcim:device', accessor=Accessor('interface.device'),
|
||||
args=[Accessor('interface.device.pk')], verbose_name='Device')
|
||||
lag = tables.Column(verbose_name='Lag')
|
||||
lag = tables.Column(verbose_name='Lag ID')
|
||||
name = tables.Column(verbose_name='Interface')
|
||||
mac_address = tables.Column(verbose_name='MAC Address')
|
||||
form_factor = tables.Column(verbose_name='Form Factor')
|
||||
@ -546,11 +546,12 @@ class InterfaceImportTable(BaseTable):
|
||||
description = tables.Column(verbose_name='Description')
|
||||
mtu = tables.Column(verbose_name='MTU')
|
||||
mgmt_only = tables.Column(verbose_name='MGMT Only')
|
||||
is_virtual = tables.Column(verbose_name='Virtual')
|
||||
is_wireless = tables.Column(verbose_name='Wireless')
|
||||
is_virtual = tables.Column(verbose_name='Is Virtual?')
|
||||
is_wireless = tables.Column(verbose_name='Is Wireless?')
|
||||
is_lag = tables.Column(verbose_name='Is Lag?')
|
||||
class Meta(BaseTable.Meta):
|
||||
model = Interface
|
||||
fields = ('device', 'lag','name','mac_address','form_factor','enabled','description','mtu','mgmt_only','is_virtual','is_wireless')
|
||||
fields = ('device', 'lag','name','mac_address','form_factor','enabled','description','mtu','mgmt_only','is_virtual','is_wireless','is_lag')
|
||||
|
||||
|
||||
class InterfaceListTable(BaseTable):
|
||||
|
Loading…
Reference in New Issue
Block a user