| From | Sent On | Attachments |
|---|---|---|
| Domen Kožar | Dec 20, 2008 1:53 pm | |
| Hanno Schlichting | Dec 21, 2008 8:57 am | |
| Ross Patterson | Dec 21, 2008 10:00 am | |
| Martin Aspeli | Dec 22, 2008 2:14 am | |
| Wichert Akkerman | Dec 22, 2008 2:17 am | |
| Hanno Schlichting | Dec 22, 2008 2:42 am | |
| Ricardo Alves | Dec 22, 2008 3:12 am | |
| Wichert Akkerman | Dec 22, 2008 4:30 am | |
| Martin Aspeli | Dec 22, 2008 10:03 am | |
| Andreas Zeidler | Jan 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
-- zeidler it consulting - http://zitc.de/ - in...@zitc.de friedelstraße 31 - 12047 berlin - telefon +49 30 25563779 pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/ plone 3.0.4 is out -- get it at http://plone.org/products/plone/
------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________ Plone-developers mailing list Plon...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plone-developers





