mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-08 00:28:16 -06:00
Change annotations
This commit is contained in:
parent
67f1a50393
commit
03ed8633fa
@ -1620,15 +1620,14 @@ class InterfaceFilterForm(BootstrapMixin, forms.Form):
|
|||||||
class InterfaceListFilterForm(BootstrapMixin, forms.Form):
|
class InterfaceListFilterForm(BootstrapMixin, forms.Form):
|
||||||
model = Interface
|
model = Interface
|
||||||
q = forms.CharField(required=False, label='Search')
|
q = forms.CharField(required=False, label='Search')
|
||||||
site = forms.ModelChoiceField(required=False, queryset=Site.objects.all(), to_field_name='slug')
|
site = FilterChoiceField(
|
||||||
#site = FilterChoiceField(
|
queryset=Site.objects.annotate(filter_count=Count('member_interfaces')),
|
||||||
# queryset=Site.objects.annotate(filter_count=Count('devices')),
|
to_field_name='slug'
|
||||||
# to_field_name='slug'
|
)
|
||||||
#)
|
|
||||||
enabled = forms.ChoiceField(choices=add_blank_choice(IFACE_ENABLED_CHOICES), required=False)
|
enabled = forms.ChoiceField(choices=add_blank_choice(IFACE_ENABLED_CHOICES), required=False)
|
||||||
role = FilterChoiceField(
|
role = FilterChoiceField(
|
||||||
required=False,
|
required=False,
|
||||||
queryset=DeviceRole.objects.annotate(filter_count=Count('devices')),
|
queryset=DeviceRole.objects.annotate(filter_count=Count('member_interfaces')),
|
||||||
to_field_name='slug'
|
to_field_name='slug'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user