On Feb 13, 2006, at 6:02 AM, Thierry FLORAC wrote:
Probably a simple question...
I need to extract request's content from an event handler defined
via a subscriber.
"request" doesn't seems to be in a subscriber's context. So how can
I get it ??
option 1: make the subscriber listen for an event that has a request
attribute (perhaps one you generate).
option 2: see if there's another way to do what you want
option 3: grab it by force from the thread locals--something like this:
from zope.publisher.interfaces import IRequest
i = zope.security.management.getInteraction() # raises
for p in i.participations:
raise RuntimeError('No IRequest in interaction')
Zope3-users mailing list