UI filter forms should filter by numeric ID rather than by slug #5894
Labels
status: accepted
This issue has been accepted for implementation
type: housekeeping
Changes to the application which do not directly impact the end user
Milestone
Proposed Changes
Currently, when filtering a list of objects within the NetBox web UI, many of the provided search fields apply a query filter based on the selected object's slug. For example, filtering for all devices in a site with the slug
raleigh4
would apply the query parameter?site=raleigh-4
.This issue proposes changing all such fields to reference the related object by its numeric ID instead. For example, the above query would become
?site_id=123
, where 123 is the site's primary key.To be clear, this does not change the behavior of the actual filters, and will not have any effect on external consumers of the REST API. It merely changes which of the existing filters NetBox's own UI uses.
Justification
Although more human-friendly, filtering by a related object's slug field requires a SQL JOIN when making the database query to pull in the related object:
Filtering by the related object's ID does not require a JOIN, because that value is stored in the filtered object's foreign key field.
The text was updated successfully, but these errors were encountered: