mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-24 09:28:38 -06:00
* Fixes #2606 - Added MultipleChoiceFilter for form_factor * Fixes #2606 - Add MultipleChoiceField for form_factor Fixes error with too many lines.
This commit is contained in:
parent
f052bbc36e
commit
7346083b26
@ -13,7 +13,7 @@ from utilities.filters import NullableCharFieldFilter, NumericInFilter, TagFilte
|
|||||||
from virtualization.models import Cluster
|
from virtualization.models import Cluster
|
||||||
from .constants import (
|
from .constants import (
|
||||||
DEVICE_STATUS_CHOICES, IFACE_FF_LAG, NONCONNECTABLE_IFACE_TYPES, SITE_STATUS_CHOICES, VIRTUAL_IFACE_TYPES,
|
DEVICE_STATUS_CHOICES, IFACE_FF_LAG, NONCONNECTABLE_IFACE_TYPES, SITE_STATUS_CHOICES, VIRTUAL_IFACE_TYPES,
|
||||||
WIRELESS_IFACE_TYPES,
|
WIRELESS_IFACE_TYPES, IFACE_FF_CHOICES,
|
||||||
)
|
)
|
||||||
from .models import (
|
from .models import (
|
||||||
ConsolePort, ConsolePortTemplate, ConsoleServerPort, ConsoleServerPortTemplate, Device, DeviceBay,
|
ConsolePort, ConsolePortTemplate, ConsoleServerPort, ConsoleServerPortTemplate, Device, DeviceBay,
|
||||||
@ -652,10 +652,14 @@ class InterfaceFilter(django_filters.FilterSet):
|
|||||||
method='filter_vlan',
|
method='filter_vlan',
|
||||||
label='Assigned VID'
|
label='Assigned VID'
|
||||||
)
|
)
|
||||||
|
form_factor = django_filters.MultipleChoiceFilter(
|
||||||
|
choices=IFACE_FF_CHOICES,
|
||||||
|
null_value=None
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Interface
|
model = Interface
|
||||||
fields = ['name', 'form_factor', 'enabled', 'mtu', 'mgmt_only']
|
fields = ['name', 'enabled', 'mtu', 'mgmt_only']
|
||||||
|
|
||||||
def filter_device(self, queryset, name, value):
|
def filter_device(self, queryset, name, value):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user