From 28e591c79fe0e16918ce993ce4b6cfad1f26eea9 Mon Sep 17 00:00:00 2001 From: jpic <jamespic@gmail.com> Date: Wed, 27 Jan 2016 02:31:10 +0100 Subject: [PATCH] Added default pagination for web browser --- representatives_votes/api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/representatives_votes/api.py b/representatives_votes/api.py index c277322..4b9403e 100644 --- a/representatives_votes/api.py +++ b/representatives_votes/api.py @@ -9,6 +9,8 @@ from rest_framework import ( viewsets, ) +from representatives.api import DefaultWebPagination + from representatives_votes.serializers import ( DossierDetailSerializer, DossierSerializer, @@ -23,6 +25,7 @@ class DossierViewSet(viewsets.ReadOnlyModelViewSet): API endpoint that allows dossiers to be viewed. """ + pagination_class = DefaultWebPagination queryset = Dossier.objects.all() serializer_class = DossierSerializer @@ -61,6 +64,7 @@ class ProposalViewSet(viewsets.ReadOnlyModelViewSet): API endpoint that allows proposals to be viewed. """ + pagination_class = DefaultWebPagination queryset = Proposal.objects.select_related('dossier') serializer_class = ProposalSerializer @@ -103,6 +107,7 @@ class VoteViewSet(viewsets.ReadOnlyModelViewSet): API endpoint that allows proposals to be viewed. """ + pagination_class = DefaultWebPagination queryset = Vote.objects.select_related('representative', 'proposal') serializer_class = VoteSerializer -- GitLab