本文整理汇总了Python中transaction.Transaction.update_step方法的典型用法代码示例。如果您正苦于以下问题:Python Transaction.update_step方法的具体用法?Python Transaction.update_step怎么用?Python Transaction.update_step使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类transaction.Transaction
的用法示例。
在下文中一共展示了Transaction.update_step方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: wrap
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import update_step [as 别名]
def wrap(request, *args, **kwargs):
first_time = xmlrpc.call('get_option', 'first-time')
if not first_time:
transaction = Transaction(request, ['mds_mmc'])
if isinstance(transaction.steps, HttpResponseRedirect):
return transaction.steps
else:
# Custom transaction for first-time
transaction.update_step({
'id': Steps.PREINST,
'title': _('Welcome'),
'info': _('Before you can install any services we need to setup a few things with you.'),
'show_modules': False
})
return HttpResponseRedirect(reverse('preinst'))
else:
return function(request, *args, **kwargs)
示例2: wrap
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import update_step [as 别名]
def wrap(request, *args, **kwargs):
first_time = xmlrpc.call("get_option", "first-time")
if not first_time:
transaction = Transaction(request, ["mds_mmc"])
if isinstance(transaction.steps, HttpResponseRedirect):
return transaction.steps
else:
# Custom transaction for first-time
transaction.update_step(
{
"id": Steps.PREINST,
"title": _("Welcome"),
"info": _("Before you can install any services we need to setup a few things with you."),
"show_modules": False,
}
)
return HttpResponseRedirect(reverse("preinst"))
else:
return function(request, *args, **kwargs)