Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

15410 removed deprecated filters #16410

Merged
merged 3 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions netbox/dcim/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,6 @@ class DeviceTypeComponentFilterSet(django_filters.FilterSet):
label=_('Device type (ID)'),
)

# TODO: Remove in v4.1
devicetype_id = device_type_id

def search(self, queryset, name, value):
if not value.strip():
return queryset
Expand All @@ -717,9 +714,6 @@ class ModularDeviceTypeComponentFilterSet(DeviceTypeComponentFilterSet):
label=_('Module type (ID)'),
)

# TODO: Remove in v4.1
moduletype_id = module_type_id


class ConsolePortTemplateFilterSet(ChangeLoggedModelFilterSet, ModularDeviceTypeComponentFilterSet):

Expand Down
8 changes: 4 additions & 4 deletions netbox/dcim/tests/test_filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def test_description(self):
params = {'description': ['foobar1', 'foobar2']}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)

def test_devicetype_id(self):
def test_device_type_id(self):
device_types = DeviceType.objects.all()[:2]
params = {'devicetype_id': [device_types[0].pk, device_types[1].pk]}
params = {'device_type_id': [device_types[0].pk, device_types[1].pk]}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)


Expand Down Expand Up @@ -1753,9 +1753,9 @@ def test_name(self):
params = {'name': ['Inventory Item 1', 'Inventory Item 2']}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 2)

def test_devicetype_id(self):
def test_device_type_id(self):
device_types = DeviceType.objects.all()[:2]
params = {'devicetype_id': [device_types[0].pk, device_types[1].pk]}
params = {'device_type_id': [device_types[0].pk, device_types[1].pk]}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 4)

def test_label(self):
Expand Down
4 changes: 0 additions & 4 deletions netbox/extras/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,6 @@ class ConfigContextFilterSet(ChangeLoggedModelFilterSet):
label=_('Data file (ID)'),
)

# TODO: Remove in v4.1
role = device_role
role_id = device_role_id

class Meta:
model = ConfigContext
fields = ('id', 'name', 'is_active', 'description', 'weight', 'auto_sync_enabled', 'data_synced')
Expand Down
8 changes: 0 additions & 8 deletions netbox/ipam/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,10 +912,6 @@ class VLANGroupFilterSet(OrganizationalModelFilterSet):
method='filter_scope'
)

# TODO: Remove in v4.1
sitegroup = site_group
clustergroup = cluster_group

class Meta:
model = VLANGroup
fields = ('id', 'name', 'slug', 'min_vid', 'max_vid', 'description', 'scope_id')
Expand Down Expand Up @@ -1106,10 +1102,6 @@ class ServiceFilterSet(NetBoxModelFilterSet):
lookup_expr='contains'
)

# TODO: Remove in v4.1
ipaddress = ip_address
ipaddress_id = ip_address_id

class Meta:
model = Service
fields = ('id', 'name', 'protocol', 'description')
Expand Down
8 changes: 4 additions & 4 deletions netbox/ipam/tests/test_filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1525,8 +1525,8 @@ def test_region(self):
params = {'region': Region.objects.first().pk}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1)

def test_sitegroup(self):
params = {'sitegroup': SiteGroup.objects.first().pk}
def test_site_group(self):
params = {'site_group': SiteGroup.objects.first().pk}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1)

def test_site(self):
Expand All @@ -1541,8 +1541,8 @@ def test_rack(self):
params = {'rack': Rack.objects.first().pk}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1)

def test_clustergroup(self):
params = {'clustergroup': ClusterGroup.objects.first().pk}
def test_cluster_group(self):
params = {'cluster_group': ClusterGroup.objects.first().pk}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 1)

def test_cluster(self):
Expand Down
8 changes: 0 additions & 8 deletions netbox/vpn/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,6 @@ class IKEPolicyFilterSet(NetBoxModelFilterSet):
to_field_name='name'
)

# TODO: Remove in v4.1
proposal = ike_proposal
proposal_id = ike_proposal_id

class Meta:
model = IKEPolicy
fields = ('id', 'name', 'preshared_key', 'description')
Expand Down Expand Up @@ -255,10 +251,6 @@ class IPSecPolicyFilterSet(NetBoxModelFilterSet):
to_field_name='name'
)

# TODO: Remove in v4.1
proposal = ipsec_proposal
proposal_id = ipsec_proposal_id

class Meta:
model = IPSecPolicy
fields = ('id', 'name', 'description')
Expand Down