A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
simplify character count query
shamoon2bdf0aae14e0
diff --git a/src/documents/views.py b/src/documents/views.pyindex ede5e0d90..9a47d928d 100644--- a/src/documents/views.py+++ b/src/documents/views.py@@ -20,6 +20,7 @@ from django.db.models import Casefrom django.db.models import Countfrom django.db.models import IntegerFieldfrom django.db.models import Max+from django.db.models import Sumfrom django.db.models import Whenfrom django.db.models.functions import Lengthfrom django.db.models.functions import Lower@@ -814,14 +815,11 @@ class StatisticsView(APIView):)character_count = (- sum(- Document.objects.annotate(characters=Length("content")).values_list(- "characters",- flat=True,- ),+ Document.objects.annotate(+ characters=Length("content"),)- if documents_total > 0- else 0+ .aggregate(Sum("characters"))+ .get("characters__sum"))return Response(