Utility can't find REQUEST

Wichert Akkerman wichert at wiggy.net
Thu Aug 30 15:24:48 UTC 2007

Previously sirgarr wrote:
> Hanno Schlichting-2 wrote:
> > 
> > Utilities are also wrapped so the Zope2 security machinery still works,
> > but their Acquisition chain does not contain the REQUEST.
> > 
> > Whenever you need the request in your code you probably want to write a
> > browser view which has access to both the context and the request. A
> > method that does some kind of work on the request but is completely
> > independent from the context could be both written as a simple method
> > (made importable TTW) or an utility. Both of these would need to take
> > the request as an argument to their function calls.
> > 
> Thanks. Is there a reason toLocalizedTime needs a REQUEST?

The current locale is stored in the request.


Wichert Akkerman <wichert at wiggy.net>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.

More information about the Product-Developers mailing list