mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-01 18:37:42 -05:00
refactor: break document-only stuff into the paperless app
The `SessionOrBasicAuthMixin` and `StandardPagination` classes were living in the documents app and I needed them in the new `reminders` app, so this commit breaks them out of `documents` and puts them in the central `paperless` app instead.
This commit is contained in:
@@ -2,15 +2,16 @@ from django.http import HttpResponse
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.views.generic import DetailView, FormView, TemplateView
|
||||
from django_filters.rest_framework import DjangoFilterBackend
|
||||
from rest_framework.filters import SearchFilter, OrderingFilter
|
||||
from paperless.db import GnuPG
|
||||
from paperless.mixins import SessionOrBasicAuthMixin
|
||||
from paperless.views import StandardPagination
|
||||
from rest_framework.filters import OrderingFilter, SearchFilter
|
||||
from rest_framework.mixins import (
|
||||
DestroyModelMixin,
|
||||
ListModelMixin,
|
||||
RetrieveModelMixin,
|
||||
UpdateModelMixin
|
||||
)
|
||||
from rest_framework.pagination import PageNumberPagination
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.viewsets import (
|
||||
GenericViewSet,
|
||||
@@ -27,7 +28,6 @@ from .serialisers import (
|
||||
LogSerializer,
|
||||
TagSerializer
|
||||
)
|
||||
from .mixins import SessionOrBasicAuthMixin
|
||||
|
||||
|
||||
class IndexView(TemplateView):
|
||||
@@ -92,12 +92,6 @@ class PushView(SessionOrBasicAuthMixin, FormView):
|
||||
return HttpResponse("0")
|
||||
|
||||
|
||||
class StandardPagination(PageNumberPagination):
|
||||
page_size = 25
|
||||
page_size_query_param = "page-size"
|
||||
max_page_size = 100000
|
||||
|
||||
|
||||
class CorrespondentViewSet(ModelViewSet):
|
||||
model = Correspondent
|
||||
queryset = Correspondent.objects.all()
|
||||
|
Reference in New Issue
Block a user