mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 01:48:38 -06:00
11014 fix rack elevation name sorting
This commit is contained in:
parent
cf0258204f
commit
4ed45e4031
@ -590,14 +590,14 @@ class RackElevationListView(generic.ObjectListView):
|
|||||||
total_count = racks.count()
|
total_count = racks.count()
|
||||||
|
|
||||||
ORDERING_CHOICES = {
|
ORDERING_CHOICES = {
|
||||||
'name': 'Name (A-Z)',
|
'_name': 'Name (A-Z)',
|
||||||
'-name': 'Name (Z-A)',
|
'-_name': 'Name (Z-A)',
|
||||||
'facility_id': 'Facility ID (A-Z)',
|
'facility_id': 'Facility ID (A-Z)',
|
||||||
'-facility_id': 'Facility ID (Z-A)',
|
'-facility_id': 'Facility ID (Z-A)',
|
||||||
}
|
}
|
||||||
sort = request.GET.get('sort', "name")
|
sort = request.GET.get('sort', "_name")
|
||||||
if sort not in ORDERING_CHOICES:
|
if sort not in ORDERING_CHOICES:
|
||||||
sort = 'name'
|
sort = '_name'
|
||||||
|
|
||||||
racks = racks.order_by(sort)
|
racks = racks.order_by(sort)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user