def __init__(self, attr_name, has_write_concern, doc=None):
"""A descriptor that wraps a PyMongo method, such as insert or remove,
and returns an asynchronous version of the method, which accepts a
callback or returns a Future.
:Parameters:
- `attr_name`: The name of the attribute on the PyMongo class, if
different from attribute on the Motor class
- `has_write_concern`: Whether the method accepts getLastError options
"""
super(Async, self).__init__(doc)
self.attr_name = attr_name
self.has_write_concern = has_write_concern
评论列表
文章目录