Skip to content

Commit

Permalink
Merge pull request #36 from RockefellerArchiveCenter/paginate
Browse files Browse the repository at this point in the history
Paginates list pages
  • Loading branch information
helrond authored Jun 18, 2019
2 parents 13bcd77 + 089cefc commit 13cf020
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions gemini/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
TMP_DIR = CF.TMP_DIR
TEST_TMP_DIR = CF.TEST_TMP_DIR

REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 25,
}

structlog.configure(
processors=[
structlog.stdlib.add_logger_name,
Expand Down
2 changes: 1 addition & 1 deletion storer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PackageViewSet(ModelViewSet):
"""
model = Package
serializer_class = PackageSerializer
queryset = Package.objects.all()
queryset = Package.objects.all().order_by('-last_modified')

def get_serializer_class(self):
if self.action == 'list':
Expand Down

0 comments on commit 13cf020

Please sign in to comment.