You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not incorrect. count is not supposed to return the number of items in the current response but the total number number of items matching the query. So you know if you need to query for more or not.
Using the py4web documentation example of pydal.restapi.
The following url
http://127.0.0.1:8000/superheroes/api/tag?@limit=1&@count=True
will give the following response
note that the
count
is incorrect, as it should be1
.I believe this is because the rows are filtered by
limit
after applying thequery
here:pydal/pydal/restapi.py
Lines 464 to 466 in daa85d4
but count is obtained using only the
query
which does not apply thelimit
pydal/pydal/restapi.py
Line 584 in daa85d4
Presumably
count
could be obtained by using the length ofrows
instead?The text was updated successfully, but these errors were encountered: