A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
some api changes
Jonas Winklerf33dca29043f
diff --git a/src/documents/filters.py b/src/documents/filters.pyindex cdf6f63b0..76a0dd296 100755--- a/src/documents/filters.py+++ b/src/documents/filters.py@@ -3,10 +3,8 @@ from django_filters.rest_framework import BooleanFilter, FilterSetfrom .models import Correspondent, Document, Tag, DocumentType-CHAR_KWARGS = (- "startswith", "endswith", "contains",- "istartswith", "iendswith", "icontains"-)+CHAR_KWARGS = ["istartswith", "iendswith", "icontains", "iexact"]+ID_KWARGS = ["in", "exact"]class CorrespondentFilterSet(FilterSet):@@ -14,11 +12,7 @@ class CorrespondentFilterSet(FilterSet):class Meta:model = Correspondentfields = {- "name": [- "startswith", "endswith", "contains",- "istartswith", "iendswith", "icontains"- ],- "slug": ["istartswith", "iendswith", "icontains"]+ "name": CHAR_KWARGS}@@ -27,11 +21,7 @@ class TagFilterSet(FilterSet):class Meta:model = Tagfields = {- "name": [- "startswith", "endswith", "contains",- "istartswith", "iendswith", "icontains"- ],- "slug": ["istartswith", "iendswith", "icontains"]+ "name": CHAR_KWARGS}@@ -40,11 +30,7 @@ class DocumentTypeFilterSet(FilterSet):class Meta:model = DocumentTypefields = {- "name": [- "startswith", "endswith", "contains",- "istartswith", "iendswith", "icontains"- ],- "slug": ["istartswith", "iendswith", "icontains"]+ "name": CHAR_KWARGS}@@ -62,15 +48,15 @@ class DocumentFilterSet(FilterSet):fields = {"title": CHAR_KWARGS,- "content": ("contains", "icontains"),+ "content": CHAR_KWARGS,+ "correspondent__id": ID_KWARGS,"correspondent__name": CHAR_KWARGS,- "correspondent__slug": CHAR_KWARGS,+ "tags__id": ID_KWARGS,"tags__name": CHAR_KWARGS,- "tags__slug": CHAR_KWARGS,- "document_type__name": CHAR_KWARGS,- "document_type__slug": CHAR_KWARGS,+ "document_type__id": ID_KWARGS,+ "document_type__name": CHAR_KWARGS}diff --git a/src/documents/serialisers.py b/src/documents/serialisers.pyindex a6ecfccaa..92b804f1b 100644--- a/src/documents/serialisers.py+++ b/src/documents/serialisers.py@@ -58,22 +58,24 @@ class DocumentTypeField(serializers.PrimaryKeyRelatedField):class DocumentSerializer(serializers.ModelSerializer):- correspondent = CorrespondentField(- allow_null=True)- tags = TagsField(many=True)- document_type = DocumentTypeField(- allow_null=True)+ correspondent_id = CorrespondentField(allow_null=True, source='correspondent')+ tags_id = TagsField(many=True, source='tags')+ document_type_id = DocumentTypeField(allow_null=True, source='document_type')class Meta:model = Document+ depth = 1fields = ("id","correspondent",+ "correspondent_id","document_type",+ "document_type_id","title","content","file_type","tags",+ "tags_id","checksum","created","modified",diff --git a/src/paperless/views.py b/src/paperless/views.pyindex b219379da..560a27980 100644--- a/src/paperless/views.py+++ b/src/paperless/views.py@@ -7,7 +7,7 @@ from rest_framework.pagination import PageNumberPaginationclass StandardPagination(PageNumberPagination):page_size = 25- page_size_query_param = "page-size"+ page_size_query_param = "page_size"max_page_size = 100000