From c6ec352e712cc64ef35aa15f5dd3c8b19531e032 Mon Sep 17 00:00:00 2001 From: Rohan Rangray Date: Thu, 30 Apr 2015 00:34:26 -0700 Subject: [PATCH] Fixed pagination. --- flashcards/views.py | 5 ----- flashy/settings.py | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flashcards/views.py b/flashcards/views.py index 9dba6dd..eff61f9 100644 --- a/flashcards/views.py +++ b/flashcards/views.py @@ -3,11 +3,6 @@ from flashcards.serializers import SectionSerializer, LecturePeriodSerializer from rest_framework.permissions import IsAuthenticatedOrReadOnly from rest_framework.viewsets import ModelViewSet -REST_FRAMEWORK = { - 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.CursorPagination', - 'PAGE_SIZE': 20 - } - class SectionViewSet(ModelViewSet): queryset = Section.objects.all() serializer_class = SectionSerializer diff --git a/flashy/settings.py b/flashy/settings.py index 712c148..6a3d0e1 100644 --- a/flashy/settings.py +++ b/flashy/settings.py @@ -42,6 +42,11 @@ INSTALLED_APPS = ( 'flashcards', ) +REST_FRAMEWORK = { + 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.CursorPagination', + 'PAGE_SIZE': 20 +} + MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', @@ -103,4 +108,4 @@ USE_TZ = True # https://docs.djangoproject.com/en/1.8/howto/static-files/ STATIC_URL = '/static/' -STATIC_ROOT = 'static' \ No newline at end of file +STATIC_ROOT = 'static' -- 1.9.1