App Engine Python ndb map_async strange behavior for deletes -
I , if I use the following query: I hope all the Such: You either need to wrap the entire operation or make a clear outcome call If the request handler may then turns very quickly, anytime < / P> / div> map_async (using through remote_api) a very simple callback tasklet that The key is removed with the key that has been passed, however, all the institutions are always always removed not in most cases, for all the institutions Has to be removed. Code:
@ ndb.tasklet def delete_key_tasklet (key): yield key.delete_async () class person (ndb.Model): name1 = ndb.StringProperty () NAME2 = ndb.StringProperty () @classmethod def delete_persons_async (CLS, ancestor_key, name): q = cls.query (ancestor = ancestor_key) q = q.filter (ndb.OR (cls.name1 == name, cls.name2 == name)) return q. map_async (delete_key_tasklet, keys_only = true), for example
Person.delete_persons_async (ancestor_key, 'David') .get_result ()
individuals organizations with the name are removed.
yield key.get_async () it will properly capture all the entities.
Comments
Post a Comment