[PR #12357] [MERGED] 12252 allow sorting on object in search #13955

Closed
opened 2025-12-29 23:21:44 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/12357
Author: @arthanson
Created: 4/27/2023
Status: Merged
Merged: 4/27/2023
Merged by: @jeremystretch

Base: developHead: 12252-search-ordering


📝 Commits (2)

  • bc9feb4 12252 allow sorting on object in search
  • 875db2e 12252 code review changes

📊 Changes

2 files changed (+8 additions, -4 deletions)

View changed files

📝 netbox/netbox/search/backends.py (+6 -3)
📝 netbox/netbox/tables/tables.py (+2 -1)

📄 Description

Fixes: #12252

Adds a name column (str of object) to allow sorting of the object column in search results:

  1. tables2 looks like it only supports sorting based on items in the query results.
  2. There is not a consistent field on object to sort on that matches the str of the object.
  3. There are max 1,000 search results returned that are already in a list, so going through all the items as doing a str should not be too bad performance wise

The alternative would be restricting this field from being sortable, but it sounds like people want to sort on this field.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/12357 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 4/27/2023 **Status:** ✅ Merged **Merged:** 4/27/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `12252-search-ordering` --- ### 📝 Commits (2) - [`bc9feb4`](https://github.com/netbox-community/netbox/commit/bc9feb4a57e358e6e2625edb586a827a0e8cdec3) 12252 allow sorting on object in search - [`875db2e`](https://github.com/netbox-community/netbox/commit/875db2e33bee9ab3ec286dd029fe37f2da416589) 12252 code review changes ### 📊 Changes **2 files changed** (+8 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/search/backends.py` (+6 -3) 📝 `netbox/netbox/tables/tables.py` (+2 -1) </details> ### 📄 Description ### Fixes: #12252 Adds a name column (str of object) to allow sorting of the object column in search results: 1. tables2 looks like it only supports sorting based on items in the query results. 2. There is not a consistent field on object to sort on that matches the str of the object. 3. There are max 1,000 search results returned that are already in a list, so going through all the items as doing a str should not be too bad performance wise The alternative would be restricting this field from being sortable, but it sounds like people want to sort on this field. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:21:44 +01:00
adam closed this issue 2025-12-29 23:21:44 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13955