There's a possibility to append ?limit=0
phrase at the end of the API URL to make the query not limit the response. Is there any way to mae it a default behavior, e.g. http://my.api.com/resources/ (without ?limit=0) will return all resources?
tastypie no limit as default behavior
As the documentation shows, you can use the limit
variable in the resource's Meta
class:
class FooResource(ModelResource):
class Meta:
limit = 0
Or you can set it for all models with the global settings variable API_LIMIT_PER_PAGE
.
That is odd! Does the same happen if you set limit to 0 on the resource individually? –
Eucken
It's capped by
max_limit
; see Jonya Murabe's answer. –
Dillon found jonya's answer to work. i did not try without max_limit –
Filigree
class FooResource(ModelResource):
class Meta:
limit = 0
max_limit = 0
© 2022 - 2024 — McMap. All rights reserved.
API_LIMIT_PER_PAGE = 0
results in limit set to1000
. So I guess there's an unbreakable limit not to make django process suffocate. Anyway, thanks! – Forte