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

API: allow specifying page size #371

Merged
merged 2 commits into from
Oct 15, 2018
Merged

Conversation

rjw57
Copy link
Member

@rjw57 rjw57 commented Oct 15, 2018

This PR breaks out the page size changes from #358 since they are usable on their own. We also configure a maximum page size of (arbitrarily) 300 items.

rjw57 added 2 commits October 15, 2018 13:38
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.
Some maximum needs to be set for the page sizes which can be returned.
Set 300 as an arbitrary maximum.
@rjw57 rjw57 requested a review from a team October 15, 2018 12:41
@rjw57
Copy link
Member Author

rjw57 commented Oct 15, 2018

@msb this PR should get you able to proceed while we wait for #358 to progress.

@msb
Copy link
Contributor

msb commented Oct 15, 2018

tested on https://test.media.cam.ac.uk for various page sizes with /media, /playlists, & /channels

@msb msb closed this Oct 15, 2018
@msb msb reopened this Oct 15, 2018
@codecov
Copy link

codecov bot commented Oct 15, 2018

Codecov Report

Merging #371 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #371      +/-   ##
==========================================
+ Coverage   91.28%   91.29%   +<.01%     
==========================================
  Files          43       43              
  Lines        1882     1884       +2     
==========================================
+ Hits         1718     1720       +2     
  Misses        164      164
Impacted Files Coverage Δ
api/views.py 94.69% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fce9f8f...353b9e3. Read the comment docs.

@msb msb merged commit 981577d into master Oct 15, 2018
@abrahammartin abrahammartin deleted the make-page-size-in-lists-configurable branch November 25, 2018 18:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants