From eb769f1b951951ebd6cb55060f2f61a8c25d5aac Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Tue, 25 Apr 2017 14:34:16 +0200 Subject: [PATCH] better ordering for tags --- .../migrations/0016_auto_20170425_1430.py | 19 +++++++++++++++++++ apps/catalogue/models/tag.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 apps/catalogue/migrations/0016_auto_20170425_1430.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 index 00000000..85258de4 --- /dev/null +++ b/apps/catalogue/migrations/0016_auto_20170425_1430.py @@ -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'}, + ), + ] diff --git a/apps/catalogue/models/tag.py b/apps/catalogue/models/tag.py index aa73f865..f727a794 100644 --- a/apps/catalogue/models/tag.py +++ b/apps/catalogue/models/tag.py @@ -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') -- 2.20.1