Re: [Zope-CMF] [dev] Should portal_setup be registered as utility?

2008-11-19 Thread Ross Patterson
Martin Aspeli <[EMAIL PROTECTED]> writes:

> yuppie wrote:
>> Hi Dieter!
>> 
>> 
>> Dieter Maurer wrote:
>>> Thus, why do local utilities registered by Five (i.e. these utilities are
>>> for Zope2 use) do not provide access to the request in the normal
>>> Zope2 way?
>> 
>> That's what we tried first. But it turned out that Zope 3's site manager 
>> code caches the utilities across request boundaries. AFAICT it would 
>> have been necessary to rewrite the registry code completely to make sure 
>> we return always the right request.
>> 
>>> If they would, local utilities were much nearer to tools and
>>> the transition would be facilitated.
>> 
>> They would be nearer to tools, but also more distant from zope 3 
>> utilities. I doubt that would really be a win.
>
> This won't solve this particular problem, but it may be worth looking at 
> how other frameworks work. Pylons, for example, has the request 
> available as "global" variable - actually a thread-local. Zope could set 
> the request as a thread local in the same way that it sets the site 
> manager (so you can get it via getSite()). Calling getRequest() would in 
> many ways be cleaner than doing self.context.REQUEST or whatever, and 
> would work regardless of whether the context was acquisition wrapped.

+100

Ross

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] [dev] Should portal_setup be registered as utility?

2008-11-19 Thread Dieter Maurer
Martin Aspeli wrote at 2008-11-18 16:25 +:
> ...
>This won't solve this particular problem, but it may be worth looking at 
>how other frameworks work. Pylons, for example, has the request 
>available as "global" variable - actually a thread-local. Zope could set 
>the request as a thread local in the same way that it sets the site 
>manager (so you can get it via getSite()). Calling getRequest() would in 
>many ways be cleaner than doing self.context.REQUEST or whatever, and 
>would work regardless of whether the context was acquisition wrapped.

That, too, would be a solution to access the often needed request --
just not the typical Zope2 one: i.e. lots of rewrites would be necessary.



-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


Re: [Zope-CMF] [dev] Should portal_setup be registered as utility?

2008-11-19 Thread Dieter Maurer
yuppie wrote at 2008-11-18 12:00 +0100:
>Dieter Maurer wrote:
>> Thus, why do local utilities registered by Five (i.e. these utilities are
>> for Zope2 use) do not provide access to the request in the normal
>> Zope2 way?
>
>That's what we tried first. But it turned out that Zope 3's site manager 
>code caches the utilities across request boundaries. AFAICT it would 
>have been necessary to rewrite the registry code completely to make sure 
>we return always the right request.
>
>> If they would, local utilities were much nearer to tools and
>> the transition would be facilitated.
>
>They would be nearer to tools, but also more distant from zope 3 
>utilities. I doubt that would really be a win.

Then, maybe, Zope 3 utilities are inadequate at many places in
to Zope 2 world: e.g. any tool that uses TALES expressions may
want to access the (current, of course) request -- especially
when they are destined for user interaction (as actions are).

In view of this, one can understand that Plone has problems with
the "setup_tool" utility registration.



-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests


[Zope-CMF] CMF Tests: 6 OK

2008-11-19 Thread CMF Tests Summarizer
Summary of messages to the cmf-tests list.
Period Tue Nov 18 12:00:00 2008 UTC to Wed Nov 19 12:00:00 2008 UTC.
There were 6 messages: 6 from CMF Tests.


Tests passed OK
---

Subject: OK : CMF-2.1 Zope-2.10 Python-2.4.5 : Linux
From: CMF Tests
Date: Tue Nov 18 20:59:30 EST 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-November/010405.html

Subject: OK : CMF-2.1 Zope-2.11 Python-2.4.5 : Linux
From: CMF Tests
Date: Tue Nov 18 21:01:00 EST 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-November/010406.html

Subject: OK : CMF-trunk Zope-2.10 Python-2.4.5 : Linux
From: CMF Tests
Date: Tue Nov 18 21:02:30 EST 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-November/010407.html

Subject: OK : CMF-trunk Zope-2.11 Python-2.4.5 : Linux
From: CMF Tests
Date: Tue Nov 18 21:04:00 EST 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-November/010408.html

Subject: OK : CMF-trunk Zope-trunk Python-2.4.5 : Linux
From: CMF Tests
Date: Tue Nov 18 21:05:30 EST 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-November/010409.html

Subject: OK : CMF-trunk Zope-trunk Python-2.5.2 : Linux
From: CMF Tests
Date: Tue Nov 18 21:07:00 EST 2008
URL: http://mail.zope.org/pipermail/cmf-tests/2008-November/010410.html

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See https://bugs.launchpad.net/zope-cmf/ for bug reports and feature requests