Table Of Contents
WTForms Changelog¶
Version 2.2.1¶
Released on June 7th, 2018
StringFieldonly sets ``data = ‘’` when form data is empty and an initial value was not provided. This fixes an issue where the default value wasn’t rendered with the initial form. (#291, #355, #401)
Version 2.2¶
Released on June 2nd, 2018
- Merged new and updated translations from the community.
- Passing
data_args to render a field converts all the underscores to hyphens when rendering the HTML attribute, not just the first one.data_foo_barbecomesdata-foo-bar. (#248) - The
UUIDvalidator uses theuuid.UUIDclass instead of a regex. (#251) SelectFieldcopies the list ofchoicespassed to it so modifying an instance’s choices will not modify the global form definition. (#286)- Fields call
process_formdata()even if the raw data is empty. (#280) - Added a
MultipleFileFieldto handle a multi-file input.FileFieldcontinues to handle only one value. The underlyingFileInputwidget gained amultipleargument. (#281) SelectFieldchoices can contain HTML (MarkupSafeMarkupobject or equivalent API) and will be rendered properly. (#302)TimeFieldandhtml5.TimeFieldwere added. (#254)- Improved
Email. Note that it is still unreasonable to validate all emails with a regex and you should prefer validating by actually sending an email. (#294) - Widgets render the
requiredattribute when using a validator that provides the'required'flag, such asDataRequired. (#361) - Fix a compatibility issue with SQLAlchemy 2.1 that caused
QuerySelectFieldto fail withValueError: too many values to unpack. (#391)
Version 2.1¶
Released December 15, 2015
- Added
render_kwto allow default rendering time options. - Updated / added a number of localizations
- Updated docs
- Allow widgets to set flags
Version 2.0.2¶
Released January 18, 2015
- Added more localizations and updated some.
- Validators for email and URL can validate IDNA-encoded domain names and new TLDs
- Better
DeprecationWarnings - Support localization files in
/usr/share/locale(for distro packaging)
Version 2.0.1¶
Released July 1, 2014
- Update wheel install to conditionally install ordereddict for python 2.6.
- Doc improvements
Version 2.0¶
Released May 20, 2014
- Add new
class Metaparadigm for much more powerful customization of WTForms. - Move i18n into core. Deprecate
wtforms.ext.i18n. - Move CSRF into core. Deprecate
wtforms.ext.csrf. - Fix issue rendering SelectFields with
value=True - Make
DecimalFieldable to use babel locale-based number formatting. - Drop Python 3.2 support (Python3 support for 3.3+ only)
- passing
attr=Falseto WTForms widgets causes the value to be ignored. Uniquevalidator inwtforms.ext.sqlalchemyhas been removed.
Version 1.0.5¶
Released September 10, 2013
- Fix a bug in validators which causes translations to happen once then clobber any future translations.
ext.sqlalchemy/ext.appengine: minor cleanups / deprecation.- Allow blank string and the string
falseto be considered false values forBooleanField(configurable). This is technically a breaking change, but it is not likey to affect the majority of users adversely. ext.i18nform allows passingLANGUAGESto the constructor.
Version 1.0.4¶
Released April 28, 2013
- Add widgets and field implementations for HTML5 specialty input types.
ext.appengine: Add NDB support.- Add translations: Korean, Traditional Chinese
Version 1.0.3¶
Released January 24, 2013
- Tests complete in python 3.2/3.3.
- Localization for ru, fr.
- Minor fixes in documentation for clarity.
FieldListnow can take validators on the entireFieldList.ext.sqlalchemymodel_form:- Fix issue with
QuerySelectField - Fix issue in
ColumnDefaultconversion - Support
Enumtype
- Fix issue with
- Field class now allows traversal in Django 1.4 templates.
Version 1.0.2¶
Released August 24, 2012
- We now support Python 2.x and 3.x on the same codebase, thanks to a lot of hard work by Vinay Sajip.
- Add in ability to convert relationships to
ext.sqlalchemymodel_form - Built-in localizations for more languages
- Validator cleanup:
- Distinguish
Requiredvalidator intoInputRequiredandDataRequired - Better IP address validation, including IPv6 support.
AnyOf/NoneOfnow work properly formatting other datatypes than strings.Optionalvalidator can optionally pass through whitespace.
- Distinguish
Version 1.0.1¶
Released February 29, 2012
- Fixed issues related to building for python 3 and python pre-releases.
- Add
object_datato fields to get at the originally passed data.
Version 1.0¶
Released February 28, 2012
- Output HTML5 compact syntax by default.
- Substantial code reorg, cleanup, and test improvements
- Added
ext.csrffor a way to implement CSRF protection ext.sqlalchemy:- Support
PGInet,MACADDR, andUUIDfield conversion - Support callable defaults
- Support
ext.appengine:- model_form now supports generating forms with the same ordering as model.
- ReferencePropertyField now gets get_label like the other ORM fields
- Add localization support for WTForms built-in messages
- Python 3 support (via 2to3)
- Minor changes/fixes:
- An empty label string can be specified on fields if desired
Optionwidget can now take kwargs customization- Field subclasses can provide default validators as a class property
DateTimeFieldcan take time in microseconds- Numeric fields all set
.datatoNoneon coercion error for consistency.
Version 0.6.3¶
Released April 24, 2011
- Documentation: Substantial documentation improvements, including adding Crash Course as a sphinx document.
ext.django:QuerySetSelectField(andModelSelectField) now acceptget_labelsimilar to sqlalchemy equivalents.ext.appengine- model_form fixes:
FloatField(#50),TimeField,DateTimeField(#55) ReferencePropertyField: now properly stores model object, not key. (#48)
- model_form fixes:
Version 0.6.2¶
Released January 22, 2011
- Bug Fixes:
ext.appengine: various field fixes (#34, #48),model_formchanges (#41)- Fix issue in
Optionalwith non-string input. - Make numeric fields more consistent.
- Tests: Improve test coverage substantially.
Version 0.6.1¶
Released September 17th, 2010
- Bug Fixes:
ext.appengine ReferencePropertyField(#36, #37)- dateutil fields: render issue (r419), and consistency issue (#35)
- Optional validator failed when raw_data was absent (r418)
- Documentation: docs now mention HTML escaping functionality (#38)
- Add preliminary support for providing a translations object that can translate built-in validation and coercion errors (#32)
Version 0.6¶
Released April 25th, 2010.
- Widgets:
- HTML is now marked as safe (using
__html__) so that compatible templating engines will not auto-escape it.
- HTML is now marked as safe (using
- Fields:
Field._defaultis nowField.default.- All fields now have a
raw_dataproperty. - Fields which are select fields (including those in
.ext) can be iterated to produce options, and have anoption_widgetkwarg. - Minor bugfixes and cleanup in
FieldList,Select(Multiple)Field,QuerySelectFieldto address behavioral consistency. - Added
FloatField, based onIntegerField.
- Extensions:
- ext.appengine now supports FloatProperty and GeoPtProperty.
- ext.sqlalchemy QueryMultipleSelectField changed to QuerySelectMultipleField.
Version 0.5¶
Released February 13th, 2010.
- Added a
BaseFormclass which provides the core processing and validation functionality ofFormwithout requiring declarative subclassing. - Fields:
- Field labels now default to a humanized field name.
- Fields now have a
short_nameproperty which is the un-prefixed name. DecimalFieldnow rounds values for display without float coercion. See docs for details on how to format decimals.
- Extensions:
ext.sqlalchemy.fieldsnow has an additionalQuerySelectMultipleField, and all fields can now support multiple-column primary keys.ext.sqlalchemy.ormcontains tools for making forms from ORM models.- Added
ext.dateutilfor flexible date-time parsing. - Added
ext.appenginecontributed by Rodrigo Moraes.
- Added AnyOf and NoneOf validators.
Version 0.4¶
Released October 10th, 2009.
- Fields have much greater control over input processing. Filters have been added to implement a simple way to transform input data.
- Added fields that encapsulate advanced data structures such as dynamic lists or child forms for more powerful field composing.
- Fields now use widgets for rendering.
- All built-in validators have been converted to classes to clean up the code.
Form.auto_populateandField.populatewere renamed topopulate_objto clarify that they populate another object, not the Form or Field. This is an API breaking change.- Dropped support for Python 2.3.
Version 0.3.1¶
Released January 24th, 2009.
- Several fixes were made to the code and tests to make WTForms compatible with Python 2.3/2.4.
- Form’s properties can now be accessed via dictionary-style access such as
form['author']. This also has the intended effect of making variable lookups in Django templates more reliable. - Form and Field construction changes: Form now uses a metaclass to handle
creating its
_unbound_fieldsproperty, and Field construction now gives an instance of the newUnboundFieldclass instead of using a partial function application. These are both internal changes and do not change the API.
Version 0.3¶
Released January 18th, 2009.
Validation overhaul: Fields are now responsible for their own validation, instead of mostly relying on
Form. There are also newpre_validateandpost_validatehooks on subfields, adding a great deal of flexibility when dealing with field-level validation. Note that this is an API breaking change if you have any subfields that overrideField.validate. These will need to be updated to use the new hooks.Changes in how
process_dataandprocess_formdataare called:process_datano longer accepts thehas_formdataparameter.- At form instantiation time,
process_datawill be called only once for each field. If a model object is provided which contains the property, then this value is used. Otherwise, a keyword argument if specified is used. Failing that, the field’s default value is used. - If any form data is sent,
process_formdatawill be called afterprocess_datafor each field. If no form data is available for the given field, it is called with an empty list.
wtforms.ext.djangohas been overhauled, both to mirror features and changes of the Django 1.0 release, and to add some useful fields for working with django ORM data in forms.The
checkerkeyword argument toSelectField,SelectMultipleField, andRadioFieldhas been renamed tocoerceto reflect the actual functionality of this callable.
Version 0.2¶
Released January 13th, 2009.
- We have documentation and unit tests!
- Fields now have a
flagsproperty which contain boolean flags that are set either by the field itself or validators being specified on a field. The flags can then be used in checks in template or python code. - Changed the way fields take parameters, they are no longer quasi magic. This is a breaking change. Please see the documentation for the new syntax.
- Added optional description argument to Field, accessible on the field as
description. This provides an easy way to define e.g. help text in the same place as the form. - Added new semantics for validators which can stop the validation chain, with or without errors.
- Added a regexp validator, and removed the not_empty validator in favour of two validators, optional and required. The new validators allow control over the validation chain in addition to checking emptiness.
- Renamed
wtforms.contribtowtforms.extand reorganisedwtforms.ext.django. This is a breaking change if you were using the django extensions, but should only require changing your imports around a little. - Better support for other frameworks such as Pylons.
