Skip to main content

Another form generation library

Project description

Deform

A Python HTML form library. Please see http://docs.repoze.org/deform for the documentation.

Changes

0.5 (2010-08-25)

Features

  • Added features which make it possible to inquire about which resources (JavaScript and CSS resources) are required by all the widgets that make up a form rendering. Also make it possible for a newly created widget to specify its requirements. See “Widget Requirements and Resources” in the widgets chapter of the documentation.

  • Add the get_widget_requirements method to deform.Field objects.

  • Add the get_widget_resources method to deform.Field objects.

  • Allow deform.Field (and deform.Form) objects to accept a “resource registry” as a constructor argument.

  • Add the deform.Field.set_widgets method, which allows a (potentially nested) set of widgets to be applied to children fields of the field upon which it is called.

  • Add the deform.widget.TextInputCSV widget. This widget is exactly like the deform.widget.TextAreaCSV widget except it accepts a single line of input only.

  • The default widget for colander.Tuple schema types is now deform.widget.TextInputCSV.

  • The deform.widget.FileUploadWidget now returns an instance of deform.widget.filedict instead of a plain dictionary to make it possible (using isinstance) to tell the difference between file upload data and a plain data dictionary for highly generalized persistence code.

0.4 (2010-08-22)

Bug Fixes

  • When the hidden widget is used to deserialize a field, return colander.null rather than the empty string so that it may be used to represent non-text fields such as colander.Integer. This is isomorphic to the change done previously to deform.TextInputWidget to support nontextual empty fields.

  • Fix typo about overriding templates using set_zpt_renderer in templating chapter.

  • Fix link to imperative schema within in Colander docs within “Basics”.

  • Remove duplicate deform.widget.DateInputWidget class definition.

Features

  • Add a deform.widget.RichTextWidget widget, which adds the TinyMCE WYSIWIG javascript editor to a text area.

  • Add a deform.widget.AutocompleteInputWidget widget, which adds a text input that can be supplied a URL or iterable of choices to ease the search and selection of a finite set of choices.

  • The deform.widget.Widget class now accepts an extra keyword argument in its constructor: css_class.

  • All widgets now inherit a css_class attribute from the base deform.widget.Widget class. If css_class` contains a value, the “primary” element in the rendered widget will get a CSS class attribute equal to the value (“primary” is defined by the widget template’s implementor).

  • The deform.Field class now as an __iter__ method which iterates over the children fields of the field upon which it is called (for item in field == for item in field.children).

0.3

Bug Fixes

  • Change default form action to the empty string (rather than .). Thanks to Kiran.

Features

  • Add deform.widget.DateInputWidget widget, which is a date picker widget. This has now become the default widget for the colander.Date schema type, preferred to the date parts widget.

  • Add text input mask capability to deform.widget.TextInputWidget.

  • Add text input mask capability to deform.widget.CheckedInputWidget.

Backwards Incompatibilities

  • Custom widgets must now check for colander.null rather than None as the null sentinel value.

  • Dependency on a new (0.7) version of Colander, which has been changed to make using proper defaults possible; if you’ve used the default argument to a colander.SchemaNode, or if you’ve defined a custom Colander type, you’ll want to read the updated Colander documentation (particularly the changelist). Short story: use the missing argument instead.

  • If you’ve created a custom widget, you will need to tweak it slightly to handle the value colander.null as input to both serialize and deserialize. See the Deform docs at http://docs.repoze.org/deform for more information.

0.2 (2010-05-13)

  • Every form has a formid now, defaulting to deform. The formid is used to compute the id of the form tag as well as the button ids in the form. Previously, if a formid was not passed to the Form constructor, no id would be given to the rendered form and the form’s buttons would not be prefixed with any formid.

  • The deform.Form class now accepts two extra keyword arguments in its constructor: use_ajax and ajax_options.

    If use_ajax is True, the page is not reloaded when a submit button is pressed. Instead, the form is posted, and the result replaces the DOM node on the page.

    ajax_options is a string which allows you to pass extra options to the underlying AJAX form machinery when use_ajax is True.

  • Added a couple Ajax examples to the demo app.

  • Add a rudimentary Ajax chapter to the docs.

0.1 (2010-05-09)

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deform-0.5.tar.gz (651.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page