If so, you can simple use get() instead of fetch():
key = Users.all().filter('first_name =',"Steve").get()
if key:
db.delete(key)
BTW, I made a mistake before. "fetch(1000)" should be "fetch(500)".
----------
keakon
My blog(Chinese): www.keakon.net
Blog source code: https://bitbucket.org/keakon/doodle/
On Tue, Mar 15, 2011 at 6:20 PM, Chathum Henegama <[email protected]>wrote:
> Thanks Keakon
> 1 more thing.. it is guaranteed that attribute first_name has no
> duplicates. Do we still need to loop through the table ? as in your
> context
> while keys:
> db.delete(keys)
> keys = Users.all(keys_only=True).filter('first_name =',"Steve").fetch(1000)
>
> --
> 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.