Negation filter not working for cables - termination type #8901

Closed
opened 2025-12-29 20:42:40 +01:00 by adam · 3 comments
Owner

Originally created by @amk1969 on GitHub (Nov 30, 2023).

NetBox version

v3.6.6

Python version

3.8

Steps to Reproduce

Connect cables between different endpoint types.
List cables of one type connected to a device
List cables of the other types connected to a device

Expected Behavior

Filter expression termination_a_type__n should return cables with termination type other than queried.

Observed Behavior

Filter expression termination_a_type__n returns the same result as termination_a_type

Originally created by @amk1969 on GitHub (Nov 30, 2023). ### NetBox version v3.6.6 ### Python version 3.8 ### Steps to Reproduce Connect cables between different endpoint types. List cables of one type connected to a device List cables of the other types connected to a device ### Expected Behavior Filter expression termination_a_type__n should return cables with termination type other than queried. ### Observed Behavior Filter expression termination_a_type__n returns the same result as termination_a_type
adam added the type: bugseverity: low labels 2025-12-29 20:42:40 +01:00
adam closed this issue 2025-12-29 20:42:40 +01:00
Author
Owner

@amk1969 commented on GitHub (Nov 30, 2023):

Encountered a problem to determine type of a cable endpoint. Is there a property that would return termination_type of a particular cable object? With pynetbox I am getting the interface/console object itself, is there a way to get the value of 'object_type' used to create the cable?

Trying to workaround the above problem, I try to enumerate cables of various types. Here I found the problem when trying to confirm there is no cable connected to other endpoint than interface or console. Issue is reproducible also with current demo version, queries like
https://demo.netbox.dev/dcim/cables/?device=mysampledevice1&termination_a_type=dcim.consoleport and
https://demo.netbox.dev/dcim/cables/?device=mysampledevice1&termination_a_type__n=dcim.consoleport return the same results.

Could this be related to https://github.com/netbox-community/netbox/issues/11819 ?

Attached script reproduces the issue in the demo instance. cables-by-type.txt

@amk1969 commented on GitHub (Nov 30, 2023): Encountered a problem to determine type of a cable endpoint. Is there a property that would return termination_type of a particular cable object? With pynetbox I am getting the interface/console object itself, is there a way to get the value of 'object_type' used to create the cable? Trying to workaround the above problem, I try to enumerate cables of various types. Here I found the problem when trying to confirm there is no cable connected to other endpoint than interface or console. Issue is reproducible also with current demo version, queries like https://demo.netbox.dev/dcim/cables/?device=mysampledevice1&termination_a_type=dcim.consoleport and https://demo.netbox.dev/dcim/cables/?device=mysampledevice1&termination_a_type__n=dcim.consoleport return the same results. Could this be related to https://github.com/netbox-community/netbox/issues/11819 ? Attached script reproduces the issue in the demo instance. [cables-by-type.txt](https://github.com/netbox-community/netbox/files/13518383/cables-by-type.txt)
Author
Owner

@github-actions[bot] commented on GitHub (Mar 5, 2024):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Mar 5, 2024): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Mar 27, 2024):

Beginning with NetBox v3.7.0, the object type-specific cable termination filters introduced in #14434 should be used, as the generic filters (termination_a_type & termination_b_type) are inherently very limited in their functionality.

@jeremystretch commented on GitHub (Mar 27, 2024): Beginning with NetBox v3.7.0, the object type-specific cable termination filters introduced in #14434 should be used, as the generic filters (`termination_a_type` & `termination_b_type`) are inherently very limited in their functionality.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8901