Sort senders by name

This commit is contained in:
Daniel Quinn 2016-01-17 02:09:52 +00:00
parent d89349f272
commit 57bae9969b

View File

@ -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)