Parcourir la source

Tweaked Module ordering

Jeremy Stretch il y a 9 ans
Parent
commit
690ad29ab8
2 fichiers modifiés avec 20 ajouts et 1 suppressions
  1. 19 0
      netbox/dcim/migrations/0005_auto_20160328_2135.py
  2. 1 1
      netbox/dcim/models.py

+ 19 - 0
netbox/dcim/migrations/0005_auto_20160328_2135.py

@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.1 on 2016-03-28 21:35
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dcim', '0004_auto_20160328_2109'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='module',
+            options={'ordering': ['device__id', 'parent__id', 'name']},
+        ),
+    ]

+ 1 - 1
netbox/dcim/models.py

@@ -682,7 +682,7 @@ class Module(models.Model):
     serial = models.CharField(max_length=50, verbose_name='Serial number', blank=True)
 
     class Meta:
-        ordering = ['device', 'parent', 'name']
+        ordering = ['device__id', 'parent__id', 'name']
         unique_together = ['device', 'parent', 'name']
 
     def __unicode__(self):