now that I've had a couple of months practice with browser views in
general and formlib in particular and also because I've got a
particular itch to scratch I've started on a formlib version of
folder_contents and I've now got a skeleton version of the form. Well,
I've got the form at least!
What I've done so far:
* a view based on EditForm (haven't quite mastered redirects in
PageForm) but not using setUpEditWidgets - I pass the field values in
as 'data'. Fields are distinguished from each other using the prefix
field = form.FormField(f, n, item.id) # using an interface
self.form_fields += form.FormFields(field)
* turned the buttons into actions - probably the easiest part :-)
* generate fields (Boolean for the checkboxes)
* use a custom template to iterate through the folder items and call
the appropriate widgets. Although this works it's a bit clumsy. This
is the rather stripped-down HTML and I'm anticipating renaming on the
<form class="form" action="." method="post" enctype="multipart/form-
<tr tal:repeat="item context/contentValues">
<td tal:content="structure python: view.widgets['%s.select'
<td tal:content="structure python: view.widgets['%s.name'
<tal:loop tal:repeat="action view/actions"
tal:replace="structure action/render" />
While I can probably tidy this up to use a method in the view I'm not
convinced it's entirely the right way to do this. But it works!
I'll continue working - the actions themselves should be most
straightforward on this but would appreciate any comments.
Zope-CMF maillist - Zope-CMF@lists.zope.org
See http://collector.zope.org/CMF for bug reports and feature requests