keys = Users.all(keys_only=True).filter('first_name =',"Steve").fetch(1000)
while keys:
db.delete(keys)
keys = Users.all(keys_only=True).filter('first_name =',"Steve").fetch(1000)---------- keakon My blog(Chinese): www.keakon.net Blog source code: https://bitbucket.org/keakon/doodle/ On Tue, Mar 15, 2011 at 5:59 PM, Chathum Henegama <[email protected]>wrote: > Hi there i need to delete and item depending on one of its attributes. > If i say > Users.all().filter('first_name > =',"Steve").get().delete() > > This is not giving me the expected result. And if i loop through the > whole table and try to do it like this > > for user in range(0,Users.all().count()): > if Users.all().filter('first_name =',"Steve").get() : > Users.all().filter('first_name =',"Steve").get().delete() > > This gives me the result but i am aware that this is not a good way of > doing this job.. > Any suggestions ? > > Thanks > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
