From 9956b7ff1b4a4b0c71eb277443dacdc1a8b40238 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Thu, 12 Nov 2020 11:12:39 +0100 Subject: [PATCH] added some more fields for document file naming. --- src/documents/file_handling.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/documents/file_handling.py b/src/documents/file_handling.py index 22d5a052d..68180448c 100644 --- a/src/documents/file_handling.py +++ b/src/documents/file_handling.py @@ -73,7 +73,13 @@ def generate_filename(document): correspondent=slugify(document.correspondent), title=slugify(document.title), created=slugify(document.created), + created_year=document.created.year if document.created else "none", + created_month=document.created.month if document.created else "none", + created_day=document.created.day if document.created else "none", added=slugify(document.added), + added_year=document.added.year if document.added else "none", + added_month=document.added.month if document.added else "none", + added_day=document.added.day if document.added else "none", tags=tags, ) else: