本文整理汇总了Python中project.model.Project.entry_updated方法的典型用法代码示例。如果您正苦于以下问题:Python Project.entry_updated方法的具体用法?Python Project.entry_updated怎么用?Python Project.entry_updated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类project.model.Project
的用法示例。
在下文中一共展示了Project.entry_updated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delete
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import entry_updated [as 别名]
def delete(self, project_id, entry, entry_id):
api_key = request.args.get("api_key")
if not authorized(api_key, project_id):
return jsonify({"status": False})
# if project not in user.user.project:
# return jsonify({'status':False})
id = objectid.ObjectId(str(entry_id))
project = Project()
project.get(project_id)
model = project.get_entry_collection(entry)
model.delete({"_id": id})
project.entry_updated()
return jsonify({"status": True})
示例2: post
# 需要导入模块: from project.model import Project [as 别名]
# 或者: from project.model.Project import entry_updated [as 别名]
def post(self, project_id, entry):
api_key = request.args.get("api_key")
if not authorized(api_key, project_id):
return jsonify({"status": False, "message": "user is not authenticated"})
# Lets disable it for now. Until flask-principal is implemented
# if project not in user.user.project:
# return jsonify({'status':False,'message':'user don nott have access to project'})
project = Project()
project.get(project_id)
model = project.get_entry_collection(entry)
model.insert(request.json)
project.entry_updated()
return jsonify({"status": True})