From: Jan Szejko Date: Tue, 25 Apr 2017 12:34:16 +0000 (+0200) Subject: better ordering for tags X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/eb769f1b951951ebd6cb55060f2f61a8c25d5aac better ordering for tags --- 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')