if current_count == 0:
    return count
count += current_count
if current_count == 1000:
    last_key = query.fetch(1, 999)[0].key()
query = query.filter('__key__ > ', last_key)
return count
GAE: Best way to determine how many of a Kind is stored?