From 99b2cd7e02c3b3c8d033cef357c0070b9ef2ef48 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Fri, 28 Aug 2020 22:24:28 +0200 Subject: [PATCH] Order attachments by description --- attachments/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/attachments/models.py b/attachments/models.py index 9f14229..2d9573a 100644 --- a/attachments/models.py +++ b/attachments/models.py @@ -14,6 +14,9 @@ class Attachment(models.Model): original_file = models.FileField() processed_file = models.FileField(blank=True, null=True) + class Meta: + ordering = ["description"] + def __str__(self): return f"{self.description} ({self.original_file.name})"