[Product-Developers] plone.z3cform API changes

Daniel Nouri daniel.nouri at gmail.com
Thu Jul 24 10:43:36 UTC 2008


Hi,

Version 0.3 of plone.z3cform brings some (backwards incompatible) API
changes.  This is because we split the package up into two, where
plone.z3cform became the part that's reusable for the CMF folks.

If you're a user of plone.z3cform and you don't want to make changes to
your code right now to keep it working, just pin your dependency to
version 0.2 of plone.z3cform, as in "plone.z3cform==0.2".

The code changes necessary are very small.  This is what has moved:

  plone.z3cform.base -> plone.app.z3cform.layout
  plone.z3cform.wysiwyg -> plone.app.z3cform.wysiwyg
  plone.z3cform.queryselect -> plone.app.z3cform.queryselect 

As an example, here's the list of changes that were necessary in the S&D
product to upgrade it to the new version:

  http://dev.plone.org/collective/changeset/68822

The how-to on plone.org was updated to reflect these changes:

  http://plone.org/documentation/how-to/easy-forms-with-plone3

A function "wrap_form" was also added as a convenient alternative to
creating two classes per form.  Instead of:

  class MyForm(z3c.form.form.Form):
      # ...

  class MyView(plone.app.z3cform.layout.FormWrapper):
      # ...

you can now use:

 class MyForm(z3c.form.form.Form):
      # ...

  MyView = plone.app.z3cform.layout.wrap_form(MyForm)


Peace,
-- 
Daniel Nouri
http://danielnouri.org





More information about the Product-Developers mailing list