[Zope-dev] Re: request.locale

Philipp von Weitershausen philipp at weitershausen.de
Thu Sep 13 07:36:01 EDT 2007


Hanno Schlichting wrote:
> Dieter Maurer wrote:
>> Hanno Schlichting wrote at 2007-9-9 11:58 +0200:
>>> ...
>>> Obviously this needs a bit of rather hairy code
>> Indeed, as you must not define 'locale' as a request attribute
>> (it may hide 'locale' "set otherwise") but otherwise let it behave as if
>> it were an attribute.
> 
> We already do something similar for the request.debug variable, but this
> uses a stack frame hack which limits the debug attribute to be shown to
> code in the zope.* packages.
> 
> For the locale this is an undesired limitation as other code (like
> plone.app.*) would like to use this as well.
> 
> But we are already overriding each an every access method on the request
> (like __getattr__, __getitem__, ...) so stuffing some conditional code
> in there should be possible.
> 
> I'll try to implement a patch for this.

Thanks. I think you guys are on the right track.

Perhaps we can also sanitize the 'debug' issue at the same time? They 
should probably be treated equally.


-- 
http://worldcookery.com -- Professional Zope documentation and training


More information about the Zope-Dev mailing list