Skip to content
Snippets Groups Projects
Verified Commit 8435a670 authored by Frank Sauerburger's avatar Frank Sauerburger
Browse files

Add pagination to api plot-list

parent ec433d8a
Branches 81-remove-plot-list-endpoints
No related tags found
1 merge request!35Resolve "Remove plot list endpoints"
Pipeline #8370 passed
......@@ -6,3 +6,4 @@ django-inline-svg
psycopg2
django-crispy-forms
jsonschema
djangorestframework-link-header-pagination
......@@ -7,6 +7,7 @@ from rest_framework import generics, viewsets, status
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.decorators import api_view, permission_classes
from drf_link_header_pagination import LinkHeaderPagination
from uhepp_vault.models import PUBLIC_LEVEL, INTERNAL_LEVEL, PUBLIC_LEVEL, \
Collection, Plot
......@@ -124,8 +125,13 @@ class OwnModelViewSet:
# Related-objects operations:
# - Queryset filtering for related items in output, form choice
class PlotPagination(LinkHeaderPagination):
page_size = 100
class PlotViewSet(viewsets.ModelViewSet):
permission_classes = [IsCollectionOwnerOrReadOnly]
pagination_class = PlotPagination
def create(self, request, *args, **kwds):
serializer = self.get_serializer(data=request.data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment