本文整理匯總了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})