当前位置: 首页>>代码示例>>Python>>正文


Python Task.view方法代码示例

本文整理汇总了Python中models.Task.view方法的典型用法代码示例。如果您正苦于以下问题:Python Task.view方法的具体用法?Python Task.view怎么用?Python Task.view使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Task的用法示例。


在下文中一共展示了Task.view方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: edit_item

# 需要导入模块: from models import Task [as 别名]
# 或者: from models.Task import view [as 别名]
def edit_item(request, item_id, existence=False):
    item = WFItem.get(item_id)
    if not item:
        return HttpResponseNotFound()

    wf_name = "%s_editor" % item.item_type
    if existence:
        wf_name = "%s_editor_existencia" % item.item_type

    workflow = WorkFlow.view("couchflow/orig_workflows",
        include_docs=True)[wf_name].one()

    if not workflow:
        return HttpResponseNotFound()
    workflow = clone_this_wf(workflow._id, request.user._id)

    workflow.nro_pedido = get_nro_pedido()
    workflow.visible = False
    workflow.set_enabled()
    try:
        workflow.save()
    except ResourceConflict:
        pass

    task = Task.view("couchflow/activetask",
        include_docs=True)[workflow._id].one()
    if not existence:
        task.wfitems_ids = [item_id]
    else:
        task.base_item = item_id
    task.visible = False
    task.save()

    return HttpResponseRedirect("/couchflow/execute_task/%s/" % task._id)
开发者ID:GaloC,项目名称:gplib,代码行数:36,代码来源:views.py

示例2: get_nro_pedido

# 需要导入模块: from models import Task [as 别名]
# 或者: from models.Task import view [as 别名]
def get_nro_pedido():
    nro_pedido = Task.view('couchflow/max_pedido', limit=1, descending=True)
    nro_pedido = nro_pedido.one()
    if not nro_pedido:
        nro_pedido = 41
    else:
        nro_pedido = int(nro_pedido['key'])

    nro_pedido += 1
    return nro_pedido
开发者ID:GaloC,项目名称:gplib,代码行数:12,代码来源:views.py

示例3: exec_url

# 需要导入模块: from models import Task [as 别名]
# 或者: from models.Task import view [as 别名]
def exec_url(request, url_name):
    workflow = WorkFlow.view("couchflow/orig_workflows",
        include_docs=True)[url_name].one()

    if not workflow:
        return HttpResponseNotFound()

    workflow = clone_this_wf(workflow._id, request.user._id)

    workflow.nro_pedido = get_nro_pedido()
    workflow.set_enabled()
    try:
        workflow.save()
    except ResourceConflict:
        pass
    task = Task.view("couchflow/activetask",
        include_docs=True)[workflow._id].one()

    return HttpResponseRedirect("/couchflow/execute_task/%s/" % task._id)
开发者ID:GaloC,项目名称:gplib,代码行数:21,代码来源:views.py


注:本文中的models.Task.view方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。