[Grok-dev] large changes in formlib handling
faassen at startifact.com
Fri Dec 1 13:08:01 EST 2006
I've just performed a large checkin changing quite a bit about grok
deals with formlib level forms. From the checkin message:
A lot of work on formlib support. Implementation by Martijn, after
extensive discussions with JW.
Previously, we were subclassing zope.formlib.form.*Form. This lead to
rather grotty name conflicts with our basic grok View - view gives
the names 'template', and 'render' special meaning, but formlib does
Instead of untying this hairiness, we decided to use composition instead
of inheritance; instead of subclassing formlib's form, we now have
a 'form' attribute that contains the real formlib-level form.
* custom templates for forms. Get formlib specific information such
as widgets and actions from the 'form' attribute of the view.
* new barebones default templates for EditForm and DisplayForm
* can completely override a form's behavior by using form_fields on
EditForm or DisplayForm.
I expect we'll have a few smaller issues to sort out, but I think
we're on a much more solid basis now concerning forms.
More information about the Grok-dev