Filter: GT/LT Custom Date Field #7801

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

Originally created by @bradley-rose on GitHub (Mar 27, 2023).

NetBox version

v3.4.6

Feature type

Data model extension

Proposed functionality

I've introduced a few custom fields to DCIM > Device Types to track EOL Sale, EOL SW Support, and EOL HW Support dates. These are all of the type "date".

To further sell Netbox to management, one of the things they'd like to do it easily filter all device types for devices that will be EOL by a certain date. For example, to better budget for replacement equipment, refresh projects, etc., it would be great for them to navigate to DCIM > Device Types, and filter for devices that will have an EOL SW Support date before a certain deadline.

Currently, this is doable via the API, but this isn't currently an option from what I can tell in the web interface.

Here's an example query that I am able to make in the web interface:

https://<Netbox URI>/dcim/device-types/?cf_EOL_SW_Maintenance__lt=<YYYY-MM-DD>

This does properly show the filtered device types in the web interface, but there's no simple way to generate this query from the filtering options provided in the web interface.

Use case

This simplifies any custom date field for any purpose whatsoever. In my case, management can log into the web interface and create a budget estimate for replacing end-of-life equipment with a point-and-click filter. They're not going to want to write their own URI-based query or make an API call.

Database changes

No response

External dependencies

No response

Originally created by @bradley-rose on GitHub (Mar 27, 2023). ### NetBox version v3.4.6 ### Feature type Data model extension ### Proposed functionality I've introduced a few custom fields to DCIM > Device Types to track EOL Sale, EOL SW Support, and EOL HW Support dates. These are all of the type "date". To further sell Netbox to management, one of the things they'd like to do it easily filter all device types for devices that will be EOL by a certain date. For example, to better budget for replacement equipment, refresh projects, etc., it would be great for them to navigate to DCIM > Device Types, and filter for devices that will have an EOL SW Support date before a certain deadline. Currently, this is doable via the API, but this isn't currently an option from what I can tell in the web interface. Here's an example query that I am able to make in the web interface: `https://<Netbox URI>/dcim/device-types/?cf_EOL_SW_Maintenance__lt=<YYYY-MM-DD>` This does properly show the filtered device types in the web interface, but there's no simple way to generate this query from the filtering options provided in the web interface. ### Use case This simplifies any custom date field for any purpose whatsoever. In my case, management can log into the web interface and create a budget estimate for replacing end-of-life equipment with a point-and-click filter. They're not going to want to write their own URI-based query or make an API call. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: feature label 2025-12-29 20:28:22 +01:00
adam closed this issue 2025-12-29 20:28:22 +01:00
Author
Owner

@jeremystretch commented on GitHub (May 4, 2023):

The REST API and the UI use the same underlying filtersets, so what's possible via one interface is possible via the other. However, you may need to craft the URL manually as modifiers (such as less than/greater than) are not available within the filter form. #7604 has already been opened to implement this functionality, so I'm going to close this as it should be covered by that FR.

@jeremystretch commented on GitHub (May 4, 2023): The REST API and the UI use the same underlying filtersets, so what's possible via one interface is possible via the other. However, you may need to craft the URL manually as modifiers (such as less than/greater than) are not available within the filter form. #7604 has already been opened to implement this functionality, so I'm going to close this as it should be covered by that FR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7801