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

Filter on mac address on interface #974

Merged
merged 4 commits into from
Mar 23, 2017
Merged

Filter on mac address on interface #974

merged 4 commits into from
Mar 23, 2017

Conversation

marc-us
Copy link
Contributor

@marc-us marc-us commented Mar 18, 2017

Extension to be able search by mac address of interface via API.
Just a small change, please merge it.

@jeremystretch
Copy link
Member

Per the pull request template, all PRs should have an issue opened for discussion prior to submission. In the future please open an issue first to avoid potentially wasting effort.

if not value:
return queryset
try:
return queryset.filter(mac_address=value).distinct()
Copy link
Member

Choose a reason for hiding this comment

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

.distinct() is unnecessary here. It's used in DeviceFilter to avoid returning duplicate Devices in the event a device has more than one interface with the same MAC address.

@marc-us
Copy link
Contributor Author

marc-us commented Mar 23, 2017

Thank you for your comment.
Next time I will keep in mind to open issue.
Right now I more understand the codebase of netbox. I have some dedicated time to it.

@jeremystretch jeremystretch merged commit fb6cfa4 into netbox-community:develop Mar 23, 2017
@jeremystretch jeremystretch mentioned this pull request Mar 23, 2017
lampwins pushed a commit to lampwins/netbox that referenced this pull request Oct 13, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 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.

2 participants