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

Dieter Maurer dieter at handshake.de
Wed Nov 19 13:50:37 EST 2008


Martin Aspeli wrote at 2008-11-18 16:25 +0000:
> ...
>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


More information about the Zope-CMF mailing list