Natural ordering breaks when sorting objects by name #1781

Closed
opened 2025-12-29 17:19:02 +01:00 by adam · 3 comments
Owner

Originally created by @jeremystretch on GitHub (Jun 11, 2018).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.2
  • NetBox version: 2.3.4

Description

Natural ordering is broken in object tables. For example:

  1. Create three new sites named Foo1, Foo2, and Foo10.
  2. Navigate to the sites list. The three sites will be listed in order.
  3. Click the "Name" header to order sites by name.
  4. The sites are now ordered Foo1, Foo10, Foo2.

This occurs because the default natural ordering is being overridden by the specification of an explicit table field (e.g. name).

Originally created by @jeremystretch on GitHub (Jun 11, 2018). ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [x] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> ### Environment * Python version: 3.5.2 * NetBox version: 2.3.4 ### Description Natural ordering is broken in object tables. For example: 1. Create three new sites named `Foo1`, `Foo2`, and `Foo10`. 2. Navigate to the sites list. The three sites will be listed in order. 3. Click the "Name" header to order sites by name. 4. The sites are now ordered `Foo1`, `Foo10`, `Foo2`. This occurs because the default natural ordering is being overridden by the specification of an explicit table field (e.g. `name`).
adam added the type: bugstatus: accepted labels 2025-12-29 17:19:03 +01:00
adam closed this issue 2025-12-29 17:19:03 +01:00
Author
Owner

@deku-m commented on GitHub (Jun 12, 2018):

It is also the same at the interface ordering at devices.
Ticket: #Interface numbering #2035

@deku-m commented on GitHub (Jun 12, 2018): It is also the same at the interface ordering at devices. Ticket: #Interface numbering #2035
Author
Owner

@jeremystretch commented on GitHub (Jun 12, 2018):

The interface sorting logic is similar but more niche and uses its own queryset manager.

@jeremystretch commented on GitHub (Jun 12, 2018): The interface sorting logic is similar but more niche and uses its own queryset manager.
Author
Owner

@jeremystretch commented on GitHub (Jun 14, 2018):

Fixed by #2158 in develop-2.4

@jeremystretch commented on GitHub (Jun 14, 2018): Fixed by #2158 in `develop-2.4`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1781