I figure one way to do a count is like this:
foo = db.GqlQuery(\"SELECT * FROM bar WHERE baz = \'baz\')
my_count = foo.count()
What I don\'
I haven't tried it, and this is an utter resource hog, but perhaps iterating with .fetch()
and specifying the offset would work?
LIMIT=1000
def count(query):
result = offset = 0
gql_query = db.GqlQuery(query)
while True:
count = gql_query.fetch(LIMIT, offset)
if count < LIMIT:
return result
result += count
offset += LIMIT