-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In LimitOffsetPagination limit=0
should revert to default limit.
#4194
Conversation
limit=0
should revert to default limit.limit=0
should revert to default limit.
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. |
I don't think |
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
|
Hm, what is difference between |
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. |
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? |
This breaks old behavior. Clients may have been using ?limit=0 to count objects. Is there any benefit of treating zero as invalid input? |
That's quite old 😀 v3.4 was mid-2016. A work around would be to subclass |
Thanks. I am doing a similar workaround. |
How did you guys fix this? |
Treat
limit=0 in the same way as an other invalid amount in the
limit` parameter.