本文整理匯總了Python中project.model.Project.get_entry方法的典型用法代碼示例。如果您正苦於以下問題:Python Project.get_entry方法的具體用法?Python Project.get_entry怎麽用?Python Project.get_entry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類project.model.Project
的用法示例。
在下文中一共展示了Project.get_entry方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: project_entry_detail
# 需要導入模塊: from project.model import Project [as 別名]
# 或者: from project.model.Project import get_entry [as 別名]
def project_entry_detail(project_id,entry_id):
# add entry should be a new form, remove from old form
permission = EditProjectPermission(project_id)
form = EntryUpdateForm(csrf_enabled=False)
# we also will need upload form FYI
project = Project()
project.get(project_id)
edit = False
print project.project.entry.keys()
entry = project.get_entry(entry_id)
if form.validate_on_submit():
if not permission.can():
abort(403)
description = form.description.data
source = form.source.data
project.update_entry(entry_id,description,source)
edit = True
# not to mention we will need a project detail
return render_template('entry_view.html',project=project,form=form,edit=edit,entry_id=entry_id,permission=permission)