From 945768a3e67274d33b6ec004ca04fab4e73d48ac Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 27 Aug 2020 22:09:18 +0200 Subject: [PATCH] Add str method to attachment --- attachments/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/attachments/models.py b/attachments/models.py index 3595a7c..9f14229 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) + def __str__(self): + return f"{self.description} ({self.original_file.name})" + def save(self, *args, **kwargs): if self.processed_file: return super().save(*args, **kwargs)