better ordering for tags
authorJan Szejko <janek37@gmail.com>
Tue, 25 Apr 2017 12:34:16 +0000 (14:34 +0200)
committerJan Szejko <janek37@gmail.com>
Tue, 25 Apr 2017 12:34:16 +0000 (14:34 +0200)
apps/catalogue/migrations/0016_auto_20170425_1430.py [new file with mode: 0644]
apps/catalogue/models/tag.py

diff --git a/apps/catalogue/migrations/0016_auto_20170425_1430.py b/apps/catalogue/migrations/0016_auto_20170425_1430.py
new file mode 100644 (file)
index 0000000..85258de
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.6 on 2017-04-25 14:30
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('catalogue', '0015_auto_20170411_1545'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='tag',
+            options={'ordering': ['category', 'index', 'label'], 'verbose_name': 'tag', 'verbose_name_plural': 'tags'},
+        ),
+    ]
index aa73f86..f727a79 100644 (file)
@@ -37,7 +37,7 @@ class Tag(models.Model):
     index = models.IntegerField()
 
     class Meta:
-        ordering = ['index', 'label']
+        ordering = ['category', 'index', 'label']
         verbose_name = _('tag')
         verbose_name_plural = _('tags')