Browse Source

Corrected CustomField ordering

Jeremy Stretch 8 years ago
parent
commit
25c46894b4
2 changed files with 3 additions and 3 deletions
  1. 2 2
      netbox/extras/migrations/0002_custom_fields.py
  2. 1 1
      netbox/extras/models.py

+ 2 - 2
netbox/extras/migrations/0002_custom_fields.py

@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
 # -*- coding: utf-8 -*-
-# Generated by Django 1.10 on 2016-08-23 16:10
+# Generated by Django 1.10 on 2016-08-23 16:24
 from __future__ import unicode_literals
 from __future__ import unicode_literals
 
 
 from django.db import migrations, models
 from django.db import migrations, models
@@ -28,7 +28,7 @@ class Migration(migrations.Migration):
                 ('obj_type', models.ManyToManyField(help_text=b'The object(s) to which this field applies.', related_name='custom_fields', to='contenttypes.ContentType', verbose_name=b'Object(s)')),
                 ('obj_type', models.ManyToManyField(help_text=b'The object(s) to which this field applies.', related_name='custom_fields', to='contenttypes.ContentType', verbose_name=b'Object(s)')),
             ],
             ],
             options={
             options={
-                'ordering': ['name'],
+                'ordering': ['weight', 'name'],
             },
             },
         ),
         ),
         migrations.CreateModel(
         migrations.CreateModel(

+ 1 - 1
netbox/extras/models.py

@@ -97,7 +97,7 @@ class CustomField(models.Model):
                                                                      "form")
                                                                      "form")
 
 
     class Meta:
     class Meta:
-        ordering = ['name']
+        ordering = ['weight', 'name']
 
 
     def __unicode__(self):
     def __unicode__(self):
         return self.label or self.name.replace('_', ' ').capitalize()
         return self.label or self.name.replace('_', ' ').capitalize()