Skip to content

Commit 389c44e

Browse files
authored
Merge pull request #20591 from pheus/20554-add-missing-contenttypefilter-to-filtersets
Fixes #20554: Add ContentTypeFilter to several filtersets
2 parents 9cb2c78 + f23ee0a commit 389c44e

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

netbox/core/filtersets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class JobFilterSet(BaseFilterSet):
8080
method='search',
8181
label=_('Search'),
8282
)
83+
object_type = ContentTypeFilter()
8384
created = django_filters.DateTimeFilter()
8485
created__before = django_filters.DateTimeFilter(
8586
field_name='created',
@@ -169,6 +170,7 @@ class ObjectChangeFilterSet(BaseFilterSet):
169170
changed_object_type_id = django_filters.ModelMultipleChoiceFilter(
170171
queryset=ContentType.objects.all()
171172
)
173+
related_object_type = ContentTypeFilter()
172174
user_id = django_filters.ModelMultipleChoiceFilter(
173175
queryset=User.objects.all(),
174176
label=_('User (ID)'),

netbox/dcim/filtersets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1764,6 +1764,7 @@ class Meta:
17641764

17651765
class MACAddressFilterSet(NetBoxModelFilterSet):
17661766
mac_address = MultiValueMACAddressFilter()
1767+
assigned_object_type = ContentTypeFilter()
17671768
device = MultiValueCharFilter(
17681769
method='filter_device',
17691770
field_name='name',

netbox/ipam/filtersets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ class IPAddressFilterSet(NetBoxModelFilterSet, TenancyFilterSet, ContactModelFil
595595
to_field_name='rd',
596596
label=_('VRF (RD)'),
597597
)
598+
assigned_object_type = ContentTypeFilter()
598599
device = MultiValueCharFilter(
599600
method='filter_device',
600601
field_name='name',
@@ -1152,6 +1153,7 @@ def search(self, queryset, name, value):
11521153

11531154

11541155
class ServiceFilterSet(ContactModelFilterSet, NetBoxModelFilterSet):
1156+
parent_object_type = ContentTypeFilter()
11551157
device = MultiValueCharFilter(
11561158
method='filter_device',
11571159
field_name='name',

0 commit comments

Comments
 (0)