From 25c46894b4310207a82fa3aca1d6b59986340fed Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 23 Aug 2016 12:25:23 -0400 Subject: [PATCH] Corrected CustomField ordering --- netbox/extras/migrations/0002_custom_fields.py | 4 ++-- netbox/extras/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/netbox/extras/migrations/0002_custom_fields.py b/netbox/extras/migrations/0002_custom_fields.py index 60d00dceb..4afab3822 100644 --- a/netbox/extras/migrations/0002_custom_fields.py +++ b/netbox/extras/migrations/0002_custom_fields.py @@ -1,5 +1,5 @@ # -*- 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 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)')), ], options={ - 'ordering': ['name'], + 'ordering': ['weight', 'name'], }, ), migrations.CreateModel( diff --git a/netbox/extras/models.py b/netbox/extras/models.py index 16c954e33..217c75780 100644 --- a/netbox/extras/models.py +++ b/netbox/extras/models.py @@ -97,7 +97,7 @@ class CustomField(models.Model): "form") class Meta: - ordering = ['name'] + ordering = ['weight', 'name'] def __unicode__(self): return self.label or self.name.replace('_', ' ').capitalize()