Fixes #3127: Fix natural ordering of device components

This commit is contained in:
Jeremy Stretch 2019-04-30 13:25:37 -04:00
parent 7b5c1964b9
commit 5a8ba159f2
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2.5.12 (2019-04-30)
## Bug Fixes
* [#3127](https://github.com/digitalocean/netbox/issues/3127) - Fix natural ordering of device components
---
2.5.11 (2019-04-29)
## Notes

View File

@ -37,4 +37,8 @@ class NaturalOrderingManager(Manager):
else:
ordering.append(field)
# Default to using the _nat indexes if Meta.ordering is empty
if not ordering:
ordering = ('_nat1', '_nat2', '_nat3')
return queryset.order_by(*ordering)