From 57bae9969b518513938cd1afdb3208a7f8822f7f Mon Sep 17 00:00:00 2001 From: Daniel Quinn Date: Sun, 17 Jan 2016 02:09:52 +0000 Subject: [PATCH] Sort senders by name --- src/documents/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/documents/models.py b/src/documents/models.py index be00f5624..c8c7b08f6 100644 --- a/src/documents/models.py +++ b/src/documents/models.py @@ -11,6 +11,9 @@ class Sender(models.Model): name = models.CharField(max_length=128, unique=True) slug = models.SlugField() + class Meta(object): + ordering = ("name",) + def save(self, *args, **kwargs): if not self.slug: self.slug = slugify(self.name)