mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-01 18:37:42 -05:00
fixed the api
This commit is contained in:
19
src/documents/views.py
Normal file → Executable file
19
src/documents/views.py
Normal file → Executable file
@@ -18,15 +18,15 @@ from rest_framework.viewsets import (
|
||||
ReadOnlyModelViewSet
|
||||
)
|
||||
|
||||
from .filters import CorrespondentFilterSet, DocumentFilterSet, TagFilterSet
|
||||
from .filters import CorrespondentFilterSet, DocumentFilterSet, TagFilterSet, DocumentTypeFilterSet
|
||||
from .forms import UploadForm
|
||||
from .models import Correspondent, Document, Log, Tag
|
||||
from .models import Correspondent, Document, Log, Tag, DocumentType
|
||||
from .serialisers import (
|
||||
CorrespondentSerializer,
|
||||
DocumentSerializer,
|
||||
LogSerializer,
|
||||
TagSerializer
|
||||
)
|
||||
TagSerializer,
|
||||
DocumentTypeSerializer)
|
||||
|
||||
|
||||
class IndexView(TemplateView):
|
||||
@@ -108,6 +108,17 @@ class TagViewSet(ModelViewSet):
|
||||
ordering_fields = ("name", "slug")
|
||||
|
||||
|
||||
class DocumentTypeViewSet(ModelViewSet):
|
||||
model = DocumentType
|
||||
queryset = DocumentType.objects.all()
|
||||
serializer_class = DocumentTypeSerializer
|
||||
pagination_class = StandardPagination
|
||||
permission_classes = (IsAuthenticated,)
|
||||
filter_backends = (DjangoFilterBackend, OrderingFilter)
|
||||
filter_class = DocumentTypeFilterSet
|
||||
ordering_fields = ("name", "slug")
|
||||
|
||||
|
||||
class DocumentViewSet(RetrieveModelMixin,
|
||||
UpdateModelMixin,
|
||||
DestroyModelMixin,
|
||||
|
Reference in New Issue
Block a user