From db5e628e582f570d6d5b632020728ea7ddd19bff Mon Sep 17 00:00:00 2001 From: Thomas NOEL Date: Mon, 30 Jan 2017 17:09:58 +0100 Subject: [PATCH] mail: add default order, by postal or creation date (#14824) --- .../sources/mail/migrations/0012_auto_20170215_1554.py | 18 ++++++++++++++++++ welco/sources/mail/models.py | 1 + 2 files changed, 19 insertions(+) create mode 100644 welco/sources/mail/migrations/0012_auto_20170215_1554.py diff --git a/welco/sources/mail/migrations/0012_auto_20170215_1554.py b/welco/sources/mail/migrations/0012_auto_20170215_1554.py new file mode 100644 index 0000000..d51a602 --- /dev/null +++ b/welco/sources/mail/migrations/0012_auto_20170215_1554.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mail', '0011_mail_reference'), + ] + + operations = [ + migrations.AlterModelOptions( + name='mail', + options={'ordering': ['creation_timestamp', 'post_date'], 'verbose_name': 'Mail'}, + ), + ] diff --git a/welco/sources/mail/models.py b/welco/sources/mail/models.py index c5bb596..c5f0ef1 100644 --- a/welco/sources/mail/models.py +++ b/welco/sources/mail/models.py @@ -35,6 +35,7 @@ class Mail(models.Model): class Meta: verbose_name = _('Mail') + ordering = ['creation_timestamp', 'post_date'] content = models.FileField(_('Content')) post_date = models.DateField(_('Post Date'), null=True) -- 2.11.0