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
{{ message }}
This repository was archived by the owner on Sep 29, 2023. It is now read-only.
xnopasaranx edited this page Nov 8, 2019
·
4 revisions
Our documentation has a different example right now, where the query is run in a seperate method. If we want to run a query inside of a method, here is a simple way to pass a cursor:
defgetExampleEntries(self, *args, **kwargs):
query=exampleSkel().all()
query.order("creationdate")
# initialize cursor as Nonecursor=Noneret= []
# while query is runningwhileTrue:
query.cursor(cursor)
res=query.fetch()
# nothing in res means we are done and can break out of while loopifnotres:
break# if we are still running, there must be a cursor to pass and continue with next chunkcursor=query.getCursor()
ret.extend(res)
# return our query resultsreturnret
This is a concise way to handle queries with more than 99 results