本文整理汇总了Python中temba.flows.models.Flow.get_node方法的典型用法代码示例。如果您正苦于以下问题:Python Flow.get_node方法的具体用法?Python Flow.get_node怎么用?Python Flow.get_node使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类temba.flows.models.Flow
的用法示例。
在下文中一共展示了Flow.get_node方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_destination_no_check
# 需要导入模块: from temba.flows.models import Flow [as 别名]
# 或者: from temba.flows.models.Flow import get_node [as 别名]
def update_destination_no_check(self, flow, node, destination, rule=None): # pragma: no cover
""" Update the destination without doing a cycle check """
# look up our destination, we need this in order to set the correct destination_type
destination_type = ACTION_SET
action_destination = Flow.get_node(flow, destination, destination_type)
if not action_destination:
destination_type = RULE_SET
ruleset_destination = Flow.get_node(flow, destination, destination_type)
self.assertTrue(ruleset_destination, "Unable to find new destination with uuid: %s" % destination)
actionset = ActionSet.get(flow, node)
if actionset:
actionset.destination = destination
actionset.destination_type = destination_type
actionset.save()
ruleset = RuleSet.get(flow, node)
if ruleset:
rules = ruleset.get_rules()
for r in rules:
if r.uuid == rule:
r.destination = destination
r.destination_type = destination_type
ruleset.set_rules(rules)
ruleset.save()
else:
self.fail("Couldn't find node with uuid: %s" % node)