In LimitOffsetPagination limit=0 should revert to default limit.#4194
In LimitOffsetPagination limit=0 should revert to default limit.#4194lovelydinosaur merged 1 commit intomasterfrom
limit=0 should revert to default limit.#4194Conversation
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 thelimit` parameter.