Hi,
For my own crud application, I choose to generate kid template (and
checksum) at startup time. Previous templates was erased if the
chechsum of the existing templates (or if no template exists) check the
templates.
Advantages :
* generate templates that could be compiled by Kid
* user could choose to modify the templates, without need to know the
"form/widget" framework, and avoid the blank page syndrome
* user could customize widget for a more global impact and don't need
to edit templates
* user could mixed both customization facilities
About Widget, I use the same approach as Kevin except I use the
argument order instead of declare an explicite array =>
myform = TableForm(widgets.TextField("name"),
widgets.TextField("address"),
widgets.TextField("age", default=0,
validator=validators.Int()))
I also use the 3 parameter "key/fieldname", "validator" only for
widgets used for editing, and "default". I define 2 bases types for
widgets :
* Widget : use to display or edit one field
* WidgetsList : use as composite of Widget or WidgetsList
And for the crud, I define 3 families : edit, view, list
About error handling, I choose the had for every field entry in the
dict, a field names 'field_error_' set by editing widget (default is
None), like this the kid template is simple (%(key)s is replaced by the
key/fieldname):
<tr py:if="%(key)s_error_" colspan="2">
<td class="error" py:content="str(%(key)s_error_)"/>
</tr>
I also define based on the TurboEngine code a controller, and the (3)
automatics WidgetsList generators from SQLObject.
Kevin, If your interested I could send you the "crudgear" draft, and
I'll be happy to help you, like this I could work on my TG application
(night only and often offline) andbe sync with last dev.