[z3-five] propagating form/formlib fixes

yuppie y.2006_ at wcm-solutions.de
Mon Oct 2 16:28:23 CEST 2006


Hi Maciej!


Maciej Wisniowski wrote:
> Maybe it is good moment to do something with DateDisplayWidget?
> I mean - remove reference to 'request.locale' from it's code.
> There was a long thread about this on Zope list and I've even send
> proposal of modified code there.

I'd prefer to make 'request.locale' available. If we can't do that in 
general because of backwards compatibility issues we should do this at 
least in browser views. People who want to use browser views modify 
their code anyway. It should be easy for them to avoid 'locale' form 
variables.


The easiest way would be to attach locale directly to the request:

     def __init__(self, context, request):
         self.context = context
         self.request = request
         self.request.locale = getLocale(request)

A cleaner solution would use a proxy object:

     def __init__(self, context, request):
         self.context = context
         self.request = LocaleProxy(request)


Cheers,

	Yuppie




More information about the z3-five mailing list