Skip to content

Fixes #19110: Add filters by IP addresses to PrimaryIPFilterSet #19160

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

Merged
merged 2 commits into from
Apr 23, 2025

Conversation

miaow2
Copy link
Contributor

@miaow2 miaow2 commented Apr 12, 2025

Fixes: #19110

Add filters by IP addresses to PrimaryIPFilterSet

@jnovinger jnovinger requested review from a team and jnovinger and removed request for a team April 14, 2025 13:00
params = {'primary_ip6_id': [addresses[2].pk]}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 0)
params = {'primary_ip6': [str(addresses[2].address)]}
self.assertEqual(self.filterset(params, self.queryset).qs.count(), 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miaow2 , can you please update these same tests in dcim.tests.test_filtersets.py:DeviceTestCase and dcim.tests.test_filtersets.py:VirtualDeviceContextTestCase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jnovinger Hi, I've updated tests dcim.tests.test_filtersets.py:DeviceTestCase and dcim.tests.test_filtersets.py:VirtualDeviceContextTestCase

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@miaow2 miaow2 requested a review from jnovinger April 17, 2025 10:42
@jnovinger jnovinger added this to the v4.2.9 milestone Apr 23, 2025
@jnovinger jnovinger merged commit 2c3fe97 into netbox-community:main Apr 23, 2025
3 checks passed
@jnovinger jnovinger removed this from the v4.2.9 milestone Apr 23, 2025
@miaow2 miaow2 deleted the 19110-primaryip-filters branch April 23, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow VirtualMachine and Device filter by IP address from Primary IP
2 participants