Component type filters to replace is_* filters #2118

Closed
opened 2025-12-29 17:22:26 +01:00 by adam · 1 comment
Owner

Originally created by @lampwins on GitHub (Nov 12, 2018).

Environment

  • Python version: 3.7
  • NetBox version: 2.5-beta1

Proposed Functionality

Create new filters in the UI and API for device component types. These new filters should take the general form has_interfaces, has_console_ports, has_power_ports, etc. These will replace the now deprecated and removed is_* filters in 2.5-beta1. There should be a has_* filter for each component type and those filters should be available on the Device and DeviceType models in both the UI list views and the API.

Use Case

With the removal of the is_* fields from the DeviceType model in 2.5-beta1, we have lost some filtering functionality on the Device and DeviceType models related to components like interfaces, power ports, etc. Users wish to filter for devices and device types based on the boolean presence of different combinations of components.

Database Changes

None

External Dependencies

None

Originally created by @lampwins on GitHub (Nov 12, 2018). <!-- NOTE: This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/forum/#!forum/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.7 * NetBox version: 2.5-beta1 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Create new filters in the UI and API for device component types. These new filters should take the general form `has_interfaces`, `has_console_ports`, `has_power_ports`, etc. These will replace the now deprecated and removed `is_*` filters in 2.5-beta1. There should be a `has_*` filter for each component type and those filters should be available on the Device and DeviceType models in both the UI list views and the API. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case With the removal of the `is_*` fields from the DeviceType model in 2.5-beta1, we have lost some filtering functionality on the Device and DeviceType models related to components like interfaces, power ports, etc. Users wish to filter for devices and device types based on the boolean presence of different combinations of components. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes None <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 17:22:26 +01:00
adam closed this issue 2025-12-29 17:22:26 +01:00
Author
Owner

@lampwins commented on GitHub (Nov 15, 2018):

Had I looked, I have known this was mostly already implemented in af95ba48aa. I have cleaned this up a little bit to make them NullBooleanField's to make filtering on False possible from the UI. Also exposed the fields to the Device form.

@lampwins commented on GitHub (Nov 15, 2018): Had I looked, I have known this was mostly already implemented in af95ba48aa6d0b93cbea37d743213c4892dd6b96. I have cleaned this up a little bit to make them `NullBooleanField`'s to make filtering on False possible from the UI. Also exposed the fields to the Device form.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2118