Просмотр исходного кода

Fixes #2207

* Added 'id' field sort to InterfaceManager
dansheps 7 лет назад
Родитель
Сommit
61efe6102e
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      netbox/dcim/managers.py

+ 5 - 1
netbox/dcim/managers.py

@@ -64,11 +64,15 @@ class InterfaceManager(Manager):
 
 
         The original `name` field is considered in its entirety to serve as a fallback in the event interfaces do not
         The original `name` field is considered in its entirety to serve as a fallback in the event interfaces do not
         match any of the prescribed fields.
         match any of the prescribed fields.
+
+        The `id` field is included to enforce deterministic ordering of interfaces in similar vein of other device
+        components.
         """
         """
 
 
         sql_col = '{}.name'.format(self.model._meta.db_table)
         sql_col = '{}.name'.format(self.model._meta.db_table)
         ordering = [
         ordering = [
-            '_slot', '_subslot', '_position', '_subposition', '_type', '_id', '_channel', '_vc', 'name',
+            '_slot', '_subslot', '_position', '_subposition', '_type', '_id', '_channel', '_vc', 'name', 'id'
+
         ]
         ]
 
 
         fields = {
         fields = {