Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
LimitOffsetPagination limit=0 fix#3444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
jpadilla commentedSep 25, 2015
nhorelik commentedSep 25, 2015
jpadilla commentedSep 25, 2015
@nhorelik mostly just keeping the linters happy. @tomchristie@xordoquy thoughts on this? Seems like a valid enhancement to me. |
kevin-brown commentedSep 25, 2015
Seems valid, though I feel like this is something which should be handled in |
nhorelik commentedSep 25, 2015
If you set If you prefer to treat a limit of zero as an invalid query param and use the defaults for everything including when paginating the queryset, then this is a one-liner fix: just set |
xordoquy commentedSep 25, 2015
Don't the other paginators consider |
lovelydinosaur commentedSep 26, 2015
We shouldn't allow users to force an unlimited queryset to be returned. Agree that an empty set makes sense. |
mitar commentedMar 13, 2016
I also think that limit=0 should be unlimited (unlimited inside the |
mitar commentedMar 13, 2016
I made an alternative fix for this in#3990. By default, if (Personally, I prefer to use |
lovelydinosaur commentedJun 13, 2016
Closed via#4194 |
This PR fixes an uncaught ZeroDivisionError I encountered when the
limitquery paramater was set to zero when usingrest_framework.pagination.LimitOffsetPagination.I figured this should return an empty set like you might expect, but otherwise revert to the defaults.