A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Actually write the date found in the file name
Daniel Quinn1ce76a548622
diff --git a/src/documents/consumer.py b/src/documents/consumer.pyindex cc23a5b46..411e9f2db 100644--- a/src/documents/consumer.py+++ b/src/documents/consumer.py@@ -293,6 +293,9 @@ class Consumer(object):self.log("debug", "Saving record to database")+ created = file_info.created or timezone.make_aware(+ datetime.datetime.fromtimestamp(stats.st_mtime))+with open(doc, "rb") as f:document = Document.objects.create(correspondent=file_info.correspondent,@@ -300,10 +303,8 @@ class Consumer(object):content=text,file_type=file_info.extension,checksum=hashlib.md5(f.read()).hexdigest(),- created=timezone.make_aware(- datetime.datetime.fromtimestamp(stats.st_mtime)),- modified=timezone.make_aware(- datetime.datetime.fromtimestamp(stats.st_mtime))+ created=created,+ modified=created)relevant_tags = set(list(Tag.match_all(text)) + list(file_info.tags))diff --git a/src/documents/models.py b/src/documents/models.pyindex 6dd2cbb63..d4659c57e 100644--- a/src/documents/models.py+++ b/src/documents/models.py@@ -376,6 +376,7 @@ class FileInfo(object):"""We use a crude naming convention to make handling the correspondent,title, and tags easier:+ "<date> - <correspondent> - <title> - <tags>.<suffix>""<correspondent> - <title> - <tags>.<suffix>""<correspondent> - <title>.<suffix>""<title>.<suffix>"diff --git a/src/documents/tests/test_consumer.py b/src/documents/tests/test_consumer.pyindex 7bfde733a..7e303c5da 100644--- a/src/documents/tests/test_consumer.py+++ b/src/documents/tests/test_consumer.py@@ -3,7 +3,7 @@ from django.test import TestCasefrom ..models import FileInfo-class TestAttachment(TestCase):+class TestAttributes(TestCase):TAGS = ("tag1", "tag2", "tag3")EXTENSIONS = (@@ -154,7 +154,6 @@ class Permutations(TestCase):correspondent=None, title=None,extension=None, tags=None):- # print(filename)info = FileInfo.from_path(filename)# Created