Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7k
In LimitOffsetPaginationlimit=0 should revert to default limit.#4194
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
lovelydinosaur commentedJun 13, 2016
limit=0 should revert to default limit.limit=0 should revert to default limit.lovelydinosaur commentedJun 13, 2016
mitar commentedJun 13, 2016
Hm, but with this change it is not possible to ask for maximum allowed number of requests? Client has to know how much is that. |
lovelydinosaur commentedJun 13, 2016
I don't think |
kevin-brown commentedJun 13, 2016
There's a note in the docs about how you might go about doing this. http://www.django-rest-framework.org/api-guide/pagination/#drf-extensions
|
mitar commentedJun 13, 2016
Hm, what is difference between |
mitar commentedJun 13, 2016
So it seems that that extension works only when you have pagination, not when you have offset/limit approach. But maybe a similar mixin can be make for offset/limit as well. |
stschindler commentedAug 1, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Unfortunately this prevents my frontend client to get the count of a particular resource. What I've been doing is sending a Is there any other good way of doing that? |
yli-cpr commentedJan 15, 2018
This breaks old behavior. Clients may have been using ?limit=0 to count objects. Is there any benefit of treating zero as invalid input? |
carltongibson commentedJan 15, 2018
That's quite old 😀 v3.4 was mid-2016. A work around would be to subclass |
yli-cpr commentedJan 15, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks. I am doing a similar workaround. |
crazy-canux commentedJul 28, 2021
How did you guys fix this? |
Treat
limit=0 in the same way as an other invalid amount in thelimit` parameter.