Guest User

Untitled

a guest
Jun 23rd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. count = modelname.all(keys_only=True).count()
  2.  
  3. count = modelname.all(keys_only=True).count(some_upper_bound_suitable_for_you)
  4.  
  5. count = modelname.all(keys_only=True).count(some_upper_limit)
  6.  
  7. class GetCount(webapp.RequestHandler):
  8. def get(self):
  9. query = modelname.all(keys_only=True)
  10.  
  11. i = 0
  12. while True:
  13. result = query.fetch(1000)
  14. i = i + len(result)
  15. if len(result) < 1000:
  16. break
  17. cursor = query.cursor()
  18. query.with_cursor(cursor)
  19.  
  20. self.response.out.write('<p>Count: '+str(i)+'</p>')
Add Comment
Please, Sign In to add comment