Ajout de la pagination
This commit is contained in:
parent
296476ebf4
commit
b31b5cfdb5
@ -2482,7 +2482,12 @@ def clear_cache(request):
|
||||
|
||||
from rest_framework import generics
|
||||
from .serializers import EventSerializer
|
||||
from rest_framework.pagination import PageNumberPagination
|
||||
|
||||
class EventListPagination(PageNumberPagination):
|
||||
page_size = 10
|
||||
|
||||
class EventListAPIView(generics.ListAPIView):
|
||||
queryset = Event.objects.all()
|
||||
serializer_class = EventSerializer
|
||||
serializer_class = EventSerializer
|
||||
pagination_class = EventListPagination
|
Loading…
x
Reference in New Issue
Block a user