Added IFACE_ENABLED_CHOICES for InterfaceListFilterForm

This commit is contained in:
Joseph Kennedy 2017-08-04 05:23:23 -04:00
parent c97f490ee8
commit 35f3e573b3
2 changed files with 6 additions and 1 deletions

View File

@ -48,6 +48,11 @@ IFACE_ORDERING_CHOICES = [
[IFACE_ORDERING_NAME, 'Name (alphabetically)']
]
IFACE_ENABLED_CHOICES = [
[IFACE_ENABLED,'Enabled'],
[IFACE_DISABLED,'Disabled']
]
# Interface form factors
# Virtual
IFACE_FF_VIRTUAL = 0

View File

@ -1574,7 +1574,7 @@ class InterfaceFilterForm(BootstrapMixin, forms.Form):
class InterfaceListFilterForm(BootstrapMixin, forms.Form):
site = forms.ModelChoiceField(required=False, queryset=Site.objects.all(), to_field_name='slug')
device = forms.ModelChoiceField(required=False, queryset=Device.objects.all(), to_field_name='slug')
enabled = forms.ModelChoiceField(choices=((INTERFACE_ENABLED,'Enabled'),(INTERFACE_DISABLED,'Disabled')),required=False)
enabled = forms.ModelChoiceField(choices=IFACE_ENABLED_CHOICES,required=False)
role = FilterChoiceField(
queryset=DeviceRole.objects.annotate(filter_count=Count('devices')),
to_field_name='slug',