Google App Engine - Delete until count() <= 0

Posted by user365918 on Stack Overflow See other posts from Stack Overflow or by user365918
Published on 2010-06-13T23:38:48Z Indexed on 2010/06/13 23:42 UTC
Read the original article Hit count: 136

Filed under:
|

What is the difference between these 2 pieces of code?

query=Location.all(keys_only=True)
while query.count()>0:
  db.delete(query.fetch(5))

# --

while True:
  query=Location.all(keys_only=True)
  if not query.count():
    break
  db.delete(query.fetch(5))

They both work.

© Stack Overflow or respective owner

Related posts about google-app-engine

Related posts about delete