Commit 28e591c7 authored by Jamesie Pic's avatar Jamesie Pic
Browse files

Added default pagination for web browser

parent ae8a230a
...@@ -9,6 +9,8 @@ from rest_framework import ( ...@@ -9,6 +9,8 @@ from rest_framework import (
viewsets, viewsets,
) )
from representatives.api import DefaultWebPagination
from representatives_votes.serializers import ( from representatives_votes.serializers import (
DossierDetailSerializer, DossierDetailSerializer,
DossierSerializer, DossierSerializer,
...@@ -23,6 +25,7 @@ class DossierViewSet(viewsets.ReadOnlyModelViewSet): ...@@ -23,6 +25,7 @@ class DossierViewSet(viewsets.ReadOnlyModelViewSet):
API endpoint that allows dossiers to be viewed. API endpoint that allows dossiers to be viewed.
""" """
pagination_class = DefaultWebPagination
queryset = Dossier.objects.all() queryset = Dossier.objects.all()
serializer_class = DossierSerializer serializer_class = DossierSerializer
...@@ -61,6 +64,7 @@ class ProposalViewSet(viewsets.ReadOnlyModelViewSet): ...@@ -61,6 +64,7 @@ class ProposalViewSet(viewsets.ReadOnlyModelViewSet):
API endpoint that allows proposals to be viewed. API endpoint that allows proposals to be viewed.
""" """
pagination_class = DefaultWebPagination
queryset = Proposal.objects.select_related('dossier') queryset = Proposal.objects.select_related('dossier')
serializer_class = ProposalSerializer serializer_class = ProposalSerializer
...@@ -103,6 +107,7 @@ class VoteViewSet(viewsets.ReadOnlyModelViewSet): ...@@ -103,6 +107,7 @@ class VoteViewSet(viewsets.ReadOnlyModelViewSet):
API endpoint that allows proposals to be viewed. API endpoint that allows proposals to be viewed.
""" """
pagination_class = DefaultWebPagination
queryset = Vote.objects.select_related('representative', 'proposal') queryset = Vote.objects.select_related('representative', 'proposal')
serializer_class = VoteSerializer serializer_class = VoteSerializer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment