diff --git a/expenses/models.py b/expenses/models.py index 59a4f99..f61b29e 100644 --- a/expenses/models.py +++ b/expenses/models.py @@ -387,6 +387,9 @@ def is_image(self): file_regex = re.compile(".*\.(jpg|jpeg|png|gif|bmp)", re.IGNORECASE) return file_regex.match(self.file.name) + def is_pdf(self): + return self.file.name.lower().endswith(".pdf") + class ExpensePart(models.Model): """ diff --git a/templates/expenses/show.html b/templates/expenses/show.html index a10b2e4..100d954 100644 --- a/templates/expenses/show.html +++ b/templates/expenses/show.html @@ -162,19 +162,26 @@