Re: ZPublisher: using zope.formlib and z3c.form in Zope 2

Martin Aspeli <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
Hi,

On 2 March 2011 08:43, yuppie <[email protected]> wrote:
> Hi!
>
>
> ZPublisher.Publish and zope.publisher.publish process form inputs
> differently. Zope 2 returns encoded strings unchanged if no converters
> are specified. zope.publisher converts encoded strings to unicode.
>
> One major reason why zope.formlib and z3c.form can't be used directly in
> Zope 2 is the fact they expect decoded form values. five.formlib uses
> special base classes and plone.z3cform monkey patches the base classes
> in z3c.form.
>
>
> Proposal:
>
> - Products.Five.browser.decode should be moved to ZPublisher.
> processInputs and setPageEncoding are publisher related code.

+1

> - After traversal and before calling the object
> ZPublisher.Publish.publish should figure out if the object expects
> zope.publisher behavior. Either we use a new interface for this or we
> use zope.publisher.interfaces.browser.IBrowserPage: AFAICS in Zope 2
> land only zope.formlib and z3c.form based views implement IBrowserPage.

Isn't this in zope.browserpage now?

> - If the object implements that interface, the request is post processed
> using processInputs and setPageEncoding.

+1

> - plone.z3cform uses a modified version of processInputs and doesn't use
> setPageEncoding. Can anybody explain why? I guess that are no z3c.form
> specific reasons. Maybe the changes can be merged back to Zope?

processInputs() in Five was very buggy. I thought I'd merged those
changes into Zope 2?

I don't know what setPageEncoding() does, though.

Martin
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.