Adam Groszer wrote:
I'm using something like this:

def getCurrentRequest():
    return getInteraction().participations[0]

It is, of course, better if you can structure your app so you don't have to pull the request "out of thin air", but if you do, I'd be a little more careful about it. Like so:

def getRequest():


i = zope.security.management.getInteraction() # raises NoInteraction


for p in i.participations:


if IRequest.providedBy(p):


return p






    raise RuntimeError('Could not find current request.')
--
Benji York
Senior Software Engineer
Zope Corporation
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to