本文整理汇总了Python中dao.Dao.undo_merge方法的典型用法代码示例。如果您正苦于以下问题:Python Dao.undo_merge方法的具体用法?Python Dao.undo_merge怎么用?Python Dao.undo_merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dao.Dao
的用法示例。
在下文中一共展示了Dao.undo_merge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delete
# 需要导入模块: from dao import Dao [as 别名]
# 或者: from dao.Dao import undo_merge [as 别名]
def delete(self, region, id):
dao = Dao(region, mongo_client=mongo_client)
if not dao:
return 'Dao not found', 404
user = get_user_from_request(request, dao)
if not user:
return 'Permission denied', 403
if not user.admin_regions:
return "user is not an admin", 403
try:
merge_id = ObjectId(id)
except:
return "invalid ids, that wasn't an ObjectID", 400
try:
the_merge = dao.get_merge(merge_id)
dao.undo_merge(the_merge)
return "successfully undid merge", 200
except Exception as e:
print 'error merging players: ' + str(e)
return 'error merging players: ' + str(e), 400