Skip to content

Instantly share code, notes, and snippets.

@sahid
Created August 23, 2010 14:02
Show Gist options
  • Save sahid/545550 to your computer and use it in GitHub Desktop.
Save sahid/545550 to your computer and use it in GitHub Desktop.
GAE Query Counter
def query_counter (q, cursor=None, limit=500):
if cursor:
q.with_cursor (cursor)
count = q.count (limit=limit)
if count == limit:
return count + query_counter (q, q.cursor (), limit=limit)
return count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment