本文整理匯總了Python中workflow.workflow.Workflow.set方法的典型用法代碼示例。如果您正苦於以下問題:Python Workflow.set方法的具體用法?Python Workflow.set怎麽用?Python Workflow.set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類workflow.workflow.Workflow
的用法示例。
在下文中一共展示了Workflow.set方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: WorkflowDetail
# 需要導入模塊: from workflow.workflow import Workflow [as 別名]
# 或者: from workflow.workflow.Workflow import set [as 別名]
def WorkflowDetail(req, id, err=0):
v = getAdminStdVars(req)
if err == 0 and id == "":
# new workflow
workflow = Workflow(u"")
db.session.commit()
v["original_name"] = ""
elif id != "" and err == 0:
# edit workflow
workflow = getWorkflow(id)
v["original_name"] = workflow.name
else:
# error
workflow = Workflow(u"")
workflow.name = req.params.get("name", "")
workflow.set("description", req.params.get("description", ""))
#workflow.setAccess("write", req.params.get("writeaccess", ""))
v["original_name"] = req.params.get("orig_name", "")
workflow.id = req.params.get("id")
db.session.commit()
try:
rule = {"read": [r.ruleset_name for r in workflow.access_ruleset_assocs.filter_by(ruletype='read')],
"write": [r.ruleset_name for r in workflow.access_ruleset_assocs.filter_by(ruletype='write')]}
except:
rule = {"read": [], "write": []}
v["acl_read"] = makeList(req, "read", removeEmptyStrings(rule["read"]), {}, overload=0, type="read")
v["acl_write"] = makeList(req, "write", removeEmptyStrings(rule["write"]), {}, overload=0, type="write")
v["workflow"] = workflow
v["languages"] = config.languages
v["error"] = err
v["actpage"] = req.params.get("actpage")
v["csrf"] = req.csrf_token.current_token
return req.getTAL("web/admin/modules/workflows.html", v, macro="modify")