-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom field objects sort by ID rather than what they display #10721
Comments
Thank you for opening a bug report. Unfortunately, the information you have provided is not sufficient for someone else to attempt to reproduce the reported behavior. Remember, each bug report must include detailed steps that someone else can follow on a clean, empty NetBox installation to reproduce the exact problem you're experiencing. These instructions should include the creation of any involved objects, any configuration changes, and complete accounting of the actions being taken. Also be sure that your report does not reference data on the public NetBox demo, as that is subject to change at any time by an outside party and cannot be relied upon for bug reports. |
Steps to reproduce rewritten |
Unfortunately, this isn't really easily supportable with the way custom-fields are implemented. The issue here is that for object-type custom fields the ID of the object is stored so it is basically a generic-foreign-key, so the sorting is happening on the ID (which would be the creation order). It would not be straight-forward to de-reference this to the object and sort on the appropriate sub-field in a performant way for the list. After discussion we will probably look at disabling sorting on this if the custom-field is an object or multi-object type. |
NetBox version
v3.3.6
Python version
3.9
Steps to Reproduce
Expected Behavior
Gateway column to be in sorted IP address order:
172.16.6.1/24
172.16.10.1/24
172.16.42.1/24
172.16.128.1/24
Observed Behavior
Gateway column is sorted by object id (creation order):
172.16.42.1/24
172.16.10.1/24
172.16.128.1/24
172.16.6.1/24
Non-custom columns (eg: site) are sorted by their name, and not their ID
The text was updated successfully, but these errors were encountered: