ANN: FormEncode 0.3

Ian Bicking ianb at
Sat Nov 12 23:09:10 CET 2005

I'm pleased to announce FormEncode 0.3.

What is it?

FormEncode is a package for form validation and conversion.  It also
includes modules for parsing, filling, and extracting metadata from HTML
forms.  It features robust conversion both of incoming and outgoing
data, attention paid to helpful error messages, and a wide variety of
pre-build validators.  It also supports composition of validators, and
validating structured data, including nested and repeating form elements.

FormEncode is being used in several projects, including Subway,
TurboGears, and SQLObject.

Where is it?

Website and docs:

What has changed?

>From the news file:

* Allow errors to be inserted automatically into a form when using
  ``formencode.htmlfill``, when a ``<form:error>`` tag isn't found for
  an error.

* Added ``if_key_missing`` attribute to ``schema.Schema``, which will
  fill in any keys that are missing and pass them to the validator.

* ``FancyValidator`` has changed, adding ``if_invalid_python`` and
  ``validate_python`` options (which also apply to all subclasses).
  Also ``if_empty`` only applies to ``to_python`` conversions.

* ``FancyValidator`` now has a ``strip`` option, which if true and if
  input is a string, will strip whitespace from the string.

* Allow chained validators to validate otherwise-invalid forms, if
  they define a ``validate_partial`` method.  The credit card
  validator does this.

* Handle ``FieldStorage`` input (from file uploads); added a
  ``formencode.fieldstorage`` module to wrap those instances in
  something a bit nicer.  Added
  ``validators.FieldStorageUploadConverter`` to make this conversion.

* Added ``StringBoolean`` converter, which converts strings like
  ``"true"`` to Python booleans.


* A couple fixes to ``DateConverter``, ``FieldsMatch``,
  ``StringBoolean``, ``CreditCardValidator``.

* Added missing ``Validator.assert_string`` method.

* ``formencode.htmlfill_schemabuilder`` handles checkboxes better.

* Be a little more careful about how ``Invalid`` exceptions are
  created (catch some errors sooner).

* Improved handling of non-string input in ``htmlfill``.


* Some experimental work in ``formencode.formgen``.  Experimental, I

* Added an experimental ``formencode.context`` module for
  dynamically-scoped variables.

More information about the Python-announce-list mailing list