Locations are not sorted naturally
See original GitHub issueNetBox version
2.11.0
Python version
3.7
Steps to Reproduce
- Create a Location named ‘Floor 2’
- Create a Location named ‘Floor 10’
Expected Behavior
In areas where Locations are displayed (e.g. /dcim/locations
, /dcim/sites/N/
), I would expect Floor 2 to be sorted prior to Floor 10.
Observed Behavior
Floor 10 is sorted prior to Floor 2.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Netbox v3.2.2 - Location Sorting by Name (NOT Natural sorting)
2.2 - Location Sorting by Name (NOT Natural sorting) Locations does not/can't sort by name. This ruins the 'view' of nested locations.
Read more >Naturally sorting Pandas DataFrame - python - Stack Overflow
Using sort_values for pandas >= 1.1.0. With the new key argument in DataFrame.sort_values , since pandas 1.1.0 , we can directly sort a ......
Read more >Sorting for Humans : Natural Sort Order - Coding Horror
There are a few places you can find natural sort algorithms, however: ... Kate's lesson in mind: ASCIIbetical does not equal alphabetical.
Read more >MySQL Natural Sorting with ORDER BY clause
In this tutorial, you will learn about some natural sorting techniques in MySQL using the ORDER BY clause.
Read more >Object Ordering (The Java™ Tutorials > Collections > Interfaces)
Comparable implementations provide a natural ordering for a class, which allows ... If you try to sort a list, the elements of which...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately we can’t rely on sorting in Python: It needs to be done at the database level. We do have some natural ordering in place for other models as mentioned above, however the use of MPTT for locations complicates things a bit. If we do end up removing MPTT under #6587 that should unblock this issue.
Marking this as blocked by #6587