atom feed10 messages in net.sourceforge.lists.plone-developersRe: [Plone-developers] Plans to migra...
FromSent OnAttachments
Domen KožarDec 20, 2008 1:53 pm 
Hanno SchlichtingDec 21, 2008 8:57 am 
Ross PattersonDec 21, 2008 10:00 am 
Martin AspeliDec 22, 2008 2:14 am 
Wichert AkkermanDec 22, 2008 2:17 am 
Hanno SchlichtingDec 22, 2008 2:42 am 
Ricardo AlvesDec 22, 2008 3:12 am 
Wichert AkkermanDec 22, 2008 4:30 am 
Martin AspeliDec 22, 2008 10:03 am 
Andreas ZeidlerJan 15, 2009 2:53 pm 
Subject:Re: [Plone-developers] Plans to migrate Request/Response object to be global?
From:Andreas Zeidler (az@zitc.de)
Date:Jan 15, 2009 2:53:10 pm
List:net.sourceforge.lists.plone-developers

On 2008-12-21 17:58:04 +0100, Hanno Schlichting <hann@hannosch.eu> said:

Domen Kožar wrote:

Case:

Persistant utility that does connection to some "core". It is used numerous times in the project. How should developer display portal message, if it is not possible to get request object (except from passing it everytime).

Solution:

many frameworks solve this problem by making request object "global", therefore always accessbile. Plans?

Traditionally in Zope2 the request would always be available via the current context and Acquisition.

[...snip...]

I'm +1 on the idea. What do others think?

after finding me in the need for this last night and being referred to this thread by stefan this morning, i've put together `zope.globalrequest`[*] today and just made a first release for it.

This could probably look like this in practice: from repoze.zope2.request import get_request request = get_request()

well, it ended up being close enough:

from zope.globalrequest import getRequest request = getRequest()

We would probably want to lobby for something similar to be added to the ZPublisher as well, so the CMF folks could depend on it.

simply add the package (and zcml) to your buildout and you're ready to go.

hth,

andi

[*] http://pypi.python.org/pypi/zope.globalrequest/1.0a1