Added "request" attribute to PageletCreatedEvent class
authorThierry Florac <tflorac@ulthar.net>
Sat, 09 Jun 2018 00:46:05 +0200
changeset 8 a224fe9eda03
parent 7 1cfafd51022f
child 9 7865f11d8ec2
Added "request" attribute to PageletCreatedEvent class
src/pyams_pagelet/interfaces/__init__.py
--- a/src/pyams_pagelet/interfaces/__init__.py	Sat Jun 09 00:45:28 2018 +0200
+++ b/src/pyams_pagelet/interfaces/__init__.py	Sat Jun 09 00:46:05 2018 +0200
@@ -20,7 +20,7 @@
 from zope.contentprovider.interfaces import IContentProvider
 
 # import packages
-from zope.interface import implementer
+from zope.interface import implementer, Attribute
 
 
 class IPagelet(IView):
@@ -40,7 +40,13 @@
 class IPageletCreatedEvent(IObjectEvent):
     """Pagelet created event interface"""
 
+    request = Attribute('The request object')
+
 
 @implementer(IPageletCreatedEvent)
 class PageletCreatedEvent(ObjectEvent):
     """Pagelet created event"""
+
+    def __init__(self, object):
+        super(PageletCreatedEvent, self).__init__(object)
+        self.request = object.request