def DeleteAsync(keys, **kwargs):
"""
Asynchronously deletes one or more entities from the data store.
This function is identical to :func:`server.db.Delete`, except that it
returns an asynchronous object. Call ``get_result()`` on the return value to
block on the call and get the results.
"""
if conf["viur.db.caching" ]>0:
if isinstance( keys, datastore_types.Key ): #Just one:
memcache.delete( str( keys ), namespace=__CacheKeyPrefix__, seconds=__cacheLockTime__ )
elif isinstance( keys, list ):
for key in keys:
assert isinstance( key, datastore_types.Key ) or isinstance( key, basestring )
memcache.delete( str( key ), namespace=__CacheKeyPrefix__, seconds=__cacheLockTime__ )
return( datastore.DeleteAsync( keys, **kwargs ) )
评论列表
文章目录