htmlform

Class to encapsulate an HTML form, using htmlfill and htmlfill_schemabuilder (deprecated).

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.


Classes

C HTMLForm(...) ...

This class contains 8 members.

See the source for more information.