def add_son_manipulator(self, manipulator):
"""Add a new son manipulator to this database.
Newly added manipulators will be applied before existing ones.
:Parameters:
- `manipulator`: the manipulator to add
"""
# We override add_son_manipulator to unwrap the AutoReference's
# database attribute.
if isinstance(manipulator, pymongo.son_manipulator.AutoReference):
db = manipulator.database
if isinstance(db, MotorDatabase):
manipulator.database = db.delegate
self.delegate.add_son_manipulator(manipulator)
评论列表
文章目录