A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Actually handle the change to using a Sender model
Daniel Quinn2e48036f92af
diff --git a/src/documents/admin.py b/src/documents/admin.pyindex d4249bfd9..b2944426b 100644--- a/src/documents/admin.py+++ b/src/documents/admin.py@@ -7,7 +7,7 @@ from .models import Sender, Documentclass DocumentAdmin(admin.ModelAdmin):- search_fields = ("sender", "title", "content",)+ search_fields = ("sender__name", "title", "content",)list_display = ("edit", "created", "sender", "title", "pdf")list_filter = ("created", "sender")save_on_top = Truediff --git a/src/documents/management/commands/consume.py b/src/documents/management/commands/consume.pyindex df050fdb9..61a61ebdd 100644--- a/src/documents/management/commands/consume.py+++ b/src/documents/management/commands/consume.py@@ -13,9 +13,10 @@ from PIL import Imagefrom django.conf import settingsfrom django.core.management.base import BaseCommand+from django.template.defaultfilters import slugifyfrom django.utils import timezone-from documents.models import Document+from documents.models import Document, Senderclass Command(BaseCommand):@@ -170,7 +171,10 @@ class Command(BaseCommand):m = re.match(self.PARSER_REGEX, pdf)if m:- return m.group(1), m.group(2)+ sender_name, title = m.group(1), m.group(2)+ sender, __ = Sender.objects.get_or_create(+ name=sender_name, defaults={"slug": slugify(sender_name)})+ return sender, titlereturn "", ""