Skip to content
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.

Commit

Permalink
api: allow page size of lists to be configured
Browse files Browse the repository at this point in the history
Allow the page size of list responses to be specified. This is to allow
the case where one doesn't really care about the resources but one
wants the count. In this case, one can just set page_size to 1.

DRF diasallows setting page_size to 0.
  • Loading branch information
rjw57 committed Oct 15, 2018
1 parent fce9f8f commit 6ddbd55
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

class ListPagination(pagination.CursorPagination):
page_size = 50
page_size_query_param = 'page_size'


class FullTextSearchFilter(filters.SearchFilter):
Expand Down

0 comments on commit 6ddbd55

Please sign in to comment.