API filtering 'OR' logic not working when filtering IP addresses by device ID #2880

Closed
opened 2025-12-29 18:23:01 +01:00 by adam · 1 comment
Owner

Originally created by @ajknv on GitHub (Sep 17, 2019).

Originally assigned to: @kobayashi on GitHub.

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.3

Steps to Reproduce

Issue an API query with filter parameters specifying two different device IDs, for example:
https://netbox/api/ipam/ip-addresses/?device_id=13441&device_id=13442

Expected Behavior

API will return IP addresses associated with the devices having ids 13441 and 13442.

Observed Behavior

API returned only the IP addresses associated with the last given device id, in this case 13442.

Originally created by @ajknv on GitHub (Sep 17, 2019). Originally assigned to: @kobayashi on GitHub. ### Environment * Python version: 3.6.8 * NetBox version: 2.6.3 ### Steps to Reproduce Issue an API query with filter parameters specifying two different device IDs, for example: https://netbox/api/ipam/ip-addresses/?device_id=13441&device_id=13442 ### Expected Behavior API will return IP addresses associated with the devices having ids 13441 and 13442. ### Observed Behavior API returned only the IP addresses associated with the last given device id, in this case 13442.
adam added the type: bugstatus: accepted labels 2025-12-29 18:23:01 +01:00
adam closed this issue 2025-12-29 18:23:01 +01:00
Author
Owner

@DanSheps commented on GitHub (Sep 23, 2019):

device_id in ipam/filters.py is a NumberFilter.

This could at least be upgraded to a ModelMultipleChoiceFilter.

@DanSheps commented on GitHub (Sep 23, 2019): device_id in ipam/filters.py is a NumberFilter. This could at least be upgraded to a ModelMultipleChoiceFilter.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2880