[Zope-dev] ZPublisher: using zope.formlib and z3c.form in Zope 2 - modified proposal

yuppie y.2011 at wcm-solutions.de
Fri Mar 4 06:39:55 EST 2011


Hi again!


Based on the discussion I modified my proposal:

- Products.Five.browser.decode should be marked as deprecated. It 
implements charset negotiation without making sure the 'Vary' header is 
set correctly. Fixing this will cause other caching issues.

- The setPageEncoding() function will not be replaced at all. We just 
rely on HTTPResponse.setBody() if the 'Content-Type' header is not set 
explicitly by the view. It is recommended to set 
default-zpublisher-encoding to utf-8. This is how plone.z3cform 
currently handles this.

- The processInputs() function is replaced by a HTTPRequest method 
called postProcessInputs(). This method first tries to decode with 
HTTPRequest.default_encoding. If that causes failures, it falls back to 
the encodings returned by getPreferredCharsets().

- Directly after traversal ZPublisher.Publish.publish() calls 
request.postProcessInputs() if the object implements 
zope.publisher.interfaces.browser.IBrowserPage.


If there are no objections I'll implement it that way on Zope trunk.

Cheers,

	Yuppie


More information about the Zope-Dev mailing list