Skip to content

Fixes #3507: Filtering IP by multiple devices #4075

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

Conversation

kobayashi
Copy link
Contributor

Fixes: #3507

Filtering IP addresses by device id or device name

method='filter_device',
field_name='pk',
device = django_filters.ModelMultipleChoiceFilter(
field_name='interface__device__name',
Copy link
Member

Choose a reason for hiding this comment

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

This does not account for IP addresses assigned to interfaces belonging to virtual chassis members, which is why the local filter_device() method was added. The filter/method need to be adapted to pass multiple values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks the review, I will fix later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enabled filtering virtual chassis members also.

@kobayashi kobayashi force-pushed the 3507-filter-by-devices branch from 3d9f374 to d5c4a9d Compare February 9, 2020 05:44
@jeremystretch jeremystretch merged commit ebef48e into netbox-community:develop Feb 10, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API filtering 'OR' logic not working when filtering IP addresses by device ID
2 participants