Skip to content
Extraits de code Groupes Projets
Valider 28e591c7 rédigé par Jamesie Pic's avatar Jamesie Pic
Parcourir les fichiers

Added default pagination for web browser

parent ae8a230a
Branches
Étiquettes
Chargement en cours
...@@ -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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter