From 1ed52fd7a144df1ef7cb07dfc32c09f525d63495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 12 Apr 2020 14:30:43 +0200 Subject: [PATCH] misc: add default ordering for categories (#41628) --- corbo/migrations/0012_auto_20200413_1854.py | 19 +++++++++++++++++++ corbo/models.py | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 corbo/migrations/0012_auto_20200413_1854.py diff --git a/corbo/migrations/0012_auto_20200413_1854.py b/corbo/migrations/0012_auto_20200413_1854.py new file mode 100644 index 0000000..ab1f606 --- /dev/null +++ b/corbo/migrations/0012_auto_20200413_1854.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.17 on 2020-04-13 18:54 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('corbo', '0011_auto_20180426_1334'), + ] + + operations = [ + migrations.AlterModelOptions( + name='category', + options={'ordering': ['name']}, + ), + ] diff --git a/corbo/models.py b/corbo/models.py index fdc3efc..ee850ec 100644 --- a/corbo/models.py +++ b/corbo/models.py @@ -31,6 +31,9 @@ class Category(models.Model): help_text=_('if defined, announces will be automatically created from rss items')) ctime = models.DateTimeField(auto_now_add=True) + class Meta: + ordering = ['name'] + def __unicode__(self): return self.name