Introduction

Form processing can be horribly complicated. Each use case always has a weird quirk that differs from what has been done before. Rather than create another strongly coupled library I tried to create a reusable pattern that did not strongly depend on any web framework, form rendering method or form validation method. The pattern itself so far has not needed to change too much. When a developer wants to process a form it usually goes something like this: * The user is prompted with a form filled with defaults. * The user fills out and submits the form. * If there were errors then the form is redisplayed with the defaults and errors. * If there were not errors then the form input is processed and the user is either sent a message or redirected elsewhere.

That pretty much sums up all there is to it. I said earlier that it does not strongly depend on any specific tools but my examples will be using formencode and htmlfill. Also note that whichever schema is chosen for validation needs to provide a to_python method and raise formencode.Invalid exactly as formencode does upon finding errors. No strong coupling I swear!

Previous topic

Welcome to Form Process’s documentation!

Next topic

Basic Usage

This Page