The htmlform module is accessible via the formencode module.
Note
This is deprecated, as it's not that helpful.
Usage:
html = '<form action=...>...</form>'
class FormSchema(schema.Schema):
f1 = ...
form = HTMLForm(html, FormSchema())
errors = {}
if form_submitted:
form_result, errors = form.validate(request_dict)
if not errors:
do_action(form_result)
return
defaults = form.schema.from_python(get_defaults_from_model())
defaults.update(request_dict)
write(form.render(defaults, errors)
You can also embed the schema in the form, using form:required, etc., tags.
See the source for more information.