We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am very new to this, but my while loop based on your example for pagination seems to always return true.
I think it's because resp always has a "ref=next", even if that url referenced is the object itself.
https://xyz.server.com/api/v1/users?after=XYXYXYXYXXYXY&limit=1; rel="next"
is returned from : https://xyz.server.com/api/v1/users?limit=1
query_parameters = {'limit': '1'} users, resp, err = await client.list_users(query_parameters)
if resp.has_next(): users, err = await resp.next() # Returns list of 1 user after the last retrieved user
while resp.has_next(): users, err = await resp.next()
print(resp.has_next()) # False try: await resp.next() except StopAsyncIteration:
The text was updated successfully, but these errors were encountered:
Actually what we've also discovered is that the first list_users returns objects but on the first "next" page we get back dict, which breaks.
Sorry, something went wrong.
No branches or pull requests
I am very new to this, but my while loop based on your example for pagination seems to always return true.
I think it's because resp always has a "ref=next", even if that url referenced is the object itself.
https://xyz.server.com/api/v1/users?after=XYXYXYXYXXYXY&limit=1; rel="next"
is returned from : https://xyz.server.com/api/v1/users?limit=1
query_parameters = {'limit': '1'}
users, resp, err = await client.list_users(query_parameters)
Check if there more pages follow
if resp.has_next():
users, err = await resp.next() # Returns list of 1 user after the last retrieved user
Iterate through all of the rest of the pages
while resp.has_next():
users, err = await resp.next()
Do stuff with users in users
print(resp.has_next()) # False
try:
await resp.next()
except StopAsyncIteration:
Handle Exception raised
The text was updated successfully, but these errors were encountered: