當前位置: 首頁>>代碼示例>>Python>>正文


Python Workflow.id方法代碼示例

本文整理匯總了Python中workflow.workflow.Workflow.id方法的典型用法代碼示例。如果您正苦於以下問題:Python Workflow.id方法的具體用法?Python Workflow.id怎麽用?Python Workflow.id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在workflow.workflow.Workflow的用法示例。


在下文中一共展示了Workflow.id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: WorkflowDetail

# 需要導入模塊: from workflow.workflow import Workflow [as 別名]
# 或者: from workflow.workflow.Workflow import id [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")
開發者ID:mediatum,項目名稱:mediatum,代碼行數:39,代碼來源:workflows.py


注:本文中的workflow.workflow.Workflow.id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。