Back to index

plone3  3.1.7
lifecycle.py
Go to the documentation of this file.
00001 from zope.event import notify
00002 
00003 from Acquisition import aq_inner
00004 
00005 from Products.Five.browser import BrowserView
00006 
00007 from Products.Archetypes.event import EditBegunEvent
00008 from Products.Archetypes.event import EditCancelledEvent
00009 
00010 class Lifecycle(BrowserView):
00011     """Helper functions to trigger lifecycle events from TTW code
00012     """
00013 
00014     def begin_edit(self):
00015         """Cancel an edit operation
00016         """
00017         notify(EditBegunEvent(aq_inner(self.context)))
00018 
00019     def cancel_edit(self):
00020         """Cancel an edit operation
00021         """
00022         notify(EditCancelledEvent(aq_inner(self.context)))