本文整理汇总了Python中plone.app.iterate.interfaces.ICheckinCheckoutPolicy.cancelCheckout方法的典型用法代码示例。如果您正苦于以下问题:Python ICheckinCheckoutPolicy.cancelCheckout方法的具体用法?Python ICheckinCheckoutPolicy.cancelCheckout怎么用?Python ICheckinCheckoutPolicy.cancelCheckout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plone.app.iterate.interfaces.ICheckinCheckoutPolicy
的用法示例。
在下文中一共展示了ICheckinCheckoutPolicy.cancelCheckout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __call__
# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import cancelCheckout [as 别名]
def __call__(self):
context = aq_inner(self.context)
if self.request.form.has_key('form.button.Cancel'):
control = getMultiAdapter((context, self.request), name=u"iterate_control")
if not control.cancel_allowed():
raise CheckoutException(u"Not a checkout")
policy = ICheckinCheckoutPolicy(context)
baseline = policy.cancelCheckout()
baseline.reindexObject()
IStatusMessage(self.request).addStatusMessage(_(u"Checkout cancelled"), type='info')
view_url = baseline.restrictedTraverse("@@plone_context_state").view_url()
self.request.response.redirect(view_url)
elif self.request.form.has_key('form.button.Keep'):
view_url = context.restrictedTraverse("@@plone_context_state").view_url()
self.request.response.redirect(view_url)
else:
return self.template()
示例2: do_cancel
# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import cancelCheckout [as 别名]
def do_cancel(self, working_copy):
policy = ICheckinCheckoutPolicy(working_copy)
policy.cancelCheckout()