diff --git a/CHANGELOG.md b/CHANGELOG.md index ac66d83e3..82a4a7e41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +2.5.12 (2019-05-01) + +## Bug Fixes + +* [#3127](https://github.com/digitalocean/netbox/issues/3127) - Fix natural ordering of device components + +--- + 2.5.11 (2019-04-29) ## Notes diff --git a/docs/administration/replicating-netbox.md b/docs/administration/replicating-netbox.md index 08e11fe56..6dd686594 100644 --- a/docs/administration/replicating-netbox.md +++ b/docs/administration/replicating-netbox.md @@ -30,7 +30,7 @@ psql -c 'create database netbox' psql netbox < netbox.sql ``` -Keep in mind that PostgreSQL user accounts and permissions are not included with the dump: You will need to create those manually if you want to fully replicate the original database (see the [installation docs](installation/1-postgresql.md)). When setting up a development instance of NetBox, it's strongly recommended to use different credentials anyway. +Keep in mind that PostgreSQL user accounts and permissions are not included with the dump: You will need to create those manually if you want to fully replicate the original database (see the [installation docs](../installation/1-postgresql.md)). When setting up a development instance of NetBox, it's strongly recommended to use different credentials anyway. ## Export the Database Schema diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 3a93ed7e1..92b40cd5b 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -22,7 +22,7 @@ except ImportError: ) -VERSION = '2.5.11' +VERSION = '2.5.12' BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) diff --git a/netbox/utilities/managers.py b/netbox/utilities/managers.py index 724773c46..fc2497063 100644 --- a/netbox/utilities/managers.py +++ b/netbox/utilities/managers.py @@ -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)