Created
August 23, 2010 14:02
-
-
Save sahid/545550 to your computer and use it in GitHub Desktop.
GAE Query Counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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