Order attachments by description

This commit is contained in:
Gabriel Augendre 2020-08-28 22:24:28 +02:00
parent 6c3ab47a9b
commit 99b2cd7e02
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4

View file

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