summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas NOEL <tnoel@entrouvert.com>2017-01-30 16:09:58 (GMT)
committerThomas NOEL <tnoel@entrouvert.com>2017-02-15 15:43:13 (GMT)
commit44d4464ac5ae27cfddabc344467ef536511afd3d (patch)
tree593f137ab58a8c13216212d77edc784e257d71b6
parenta6ec6eb908b7b46f5e4028829b8b0f2542155015 (diff)
downloadwelco-44d4464ac5ae27cfddabc344467ef536511afd3d.zip
welco-44d4464ac5ae27cfddabc344467ef536511afd3d.tar.gz
welco-44d4464ac5ae27cfddabc344467ef536511afd3d.tar.bz2
mail: add default order, by postal or creation date (#14824)v0.44
-rw-r--r--welco/sources/mail/migrations/0011_mail_reference.py5
-rw-r--r--welco/sources/mail/models.py1
2 files changed, 6 insertions, 0 deletions
diff --git a/welco/sources/mail/migrations/0011_mail_reference.py b/welco/sources/mail/migrations/0011_mail_reference.py
index eaf5414..30bfd7d 100644
--- a/welco/sources/mail/migrations/0011_mail_reference.py
+++ b/welco/sources/mail/migrations/0011_mail_reference.py
@@ -16,4 +16,9 @@ class Migration(migrations.Migration):
name='reference',
field=models.CharField(max_length=30, null=True, verbose_name='Reference'),
),
+ 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)