Commit c6ec352e712cc64ef35aa15f5dd3c8b19531e032
1 parent
cb310dc9b3
Exists in
master
Fixed pagination.
Showing 2 changed files with 6 additions and 6 deletions Side-by-side Diff
flashcards/views.py
View file @
c6ec352
... | ... | @@ -3,11 +3,6 @@ |
3 | 3 | from rest_framework.permissions import IsAuthenticatedOrReadOnly |
4 | 4 | from rest_framework.viewsets import ModelViewSet |
5 | 5 | |
6 | -REST_FRAMEWORK = { | |
7 | - 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.CursorPagination', | |
8 | - 'PAGE_SIZE': 20 | |
9 | - } | |
10 | - | |
11 | 6 | class SectionViewSet(ModelViewSet): |
12 | 7 | queryset = Section.objects.all() |
13 | 8 | serializer_class = SectionSerializer |
flashy/settings.py
View file @
c6ec352
... | ... | @@ -42,6 +42,11 @@ |
42 | 42 | 'flashcards', |
43 | 43 | ) |
44 | 44 | |
45 | +REST_FRAMEWORK = { | |
46 | + 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.CursorPagination', | |
47 | + 'PAGE_SIZE': 20 | |
48 | +} | |
49 | + | |
45 | 50 | MIDDLEWARE_CLASSES = ( |
46 | 51 | 'django.contrib.sessions.middleware.SessionMiddleware', |
47 | 52 | 'django.middleware.common.CommonMiddleware', |