π Unreleased
email_validator. :issue:727π Released 2021εΉ΄12ζ23ζ₯
~fields.DateTimeField and other similar fields can
handle multiple formats. :issue:720 :pr:721722π Unreleased
~widgets.core.escape_html is removed,
replaced by :func:markupsafe.escape.
:class:~widgets.core.HTMLString is removed, replaced by
:class:markupsafe.Markup. (#400_)aria_ args are rendered the same way as data_ args, by
converting underscores to hyphens. aria_describedby="name-help"
becomes aria-describedby="name-help". (#239, #389)~fields.html5.IntegerField and
:class:~fields.html5.RangeInput don't render the step="1"
attribute by default. (#343_)~widgets.TextArea widget prepends a \r\n newline
when rendering to account for browsers stripping an initial line for
display. This does not affect the value. (#238, #395)~fields.core.Label text is escaped before rendering.
(#315, #375)~fields.StringField sets data to None when form
data is empty and an initial value was not provided. Although it
previously set an empty string, None is consistent with the
behavior of other fields. (#355_)~fields.SelectField no longer coerces None to "None"
allowing use of "None" as an option (#288, #289)~validators.Length gives a more helpful error message when
min and max are the same value (#266_)#326, #409)check_validators method to :class:~fields.Field which checks
if the given validators are both callable, and not classes (#298, #410)ipaddress package
(#385, #403)FieldList error list is keeps entries in orders for easier identifcation
of erroring fields (#257, #407)#413, #422)#399, #415)~validators.IPAddress docstring typo and conformed line
lengths to PEP8 (#418_)#420_)#416, #423)src directory (#397, #424)#430_)#433_)email_validator
(#429_)#471_)getattr/setattr with constant attributes with
regular variable accesses (#482, #484)false_values param in BooleanField docs (#483, #485)~fields.SelectField to skip choice validation
(#434, #493)HostnameValidation (#463_)#286: instead of copying the list of
choices, :class:~fields.SelectField now uses list() to construct
a new list of choices. (#475).. _#238: https://github.com/wtforms/wtforms/issues/238 .. _#239: https://github.com/wtforms/wtforms/issues/239 .. _#257: https://github.com/wtforms/wtforms/issues/257 .. _#266: https://github.com/wtforms/wtforms/pull/266 .. _#288: https://github.com/wtforms/wtforms/pull/288 .. _#289: https://github.com/wtforms/wtforms/issues/289 .. _#298: https://github.com/wtforms/wtforms/pull/298 .. _#315: https://github.com/wtforms/wtforms/pull/315 .. _#326: https://github.com/wtforms/wtforms/pull/326 .. _#343: https://github.com/wtforms/wtforms/pull/343 .. _#355: https://github.com/wtforms/wtforms/pull/355 .. _#375: https://github.com/wtforms/wtforms/pull/375 .. _#385: https://github.com/wtforms/wtforms/issues/385 .. _#389: https://github.com/wtforms/wtforms/pull/389 .. _#395: https://github.com/wtforms/wtforms/pull/395 .. _#397: https://github.com/wtforms/wtforms/issues/397 .. _#399: https://github.com/wtforms/wtforms/issues/399 .. _#400: https://github.com/wtforms/wtforms/pull/400 .. _#403: https://github.com/wtforms/wtforms/pull/403 .. _#407: https://github.com/wtforms/wtforms/pull/407 .. _#409: https://github.com/wtforms/wtforms/pull/409 .. _#410: https://github.com/wtforms/wtforms/pull/410 .. _#413: https://github.com/wtforms/wtforms/pull/413 .. _#415: https://github.com/wtforms/wtforms/pull/415 .. _#416: https://github.com/wtforms/wtforms/issues/416 .. _#418: https://github.com/wtforms/wtforms/pull/418 .. _#420: https://github.com/wtforms/wtforms/pull/420 .. _#422: https://github.com/wtforms/wtforms/pull/422 .. _#423: https://github.com/wtforms/wtforms/pull/423 .. _#424: https://github.com/wtforms/wtforms/pull/424 .. _#429: https://github.com/wtforms/wtforms/pull/429 .. _#430: https://github.com/wtforms/wtforms/pull/430 .. _#433: https://github.com/wtforms/wtforms/pull/433 .. _#434: https://github.com/wtforms/wtforms/issues/434 .. _#463: https://github.com/wtforms/wtforms/pull/463 .. _#471: https://github.com/wtforms/wtforms/pull/471 .. _#475: https://github.com/wtforms/wtforms/pull/475/ .. _#482: https://github.com/wtforms/wtforms/issues/482 .. _#483: https://github.com/wtforms/wtforms/issues/483 .. _#484: https://github.com/wtforms/wtforms/pull/484 .. _#485: https://github.com/wtforms/wtforms/pull/485 .. _#493: https://github.com/wtforms/wtforms/pull/493
fields.StringField sets data to None when form data is empty and an initial value was not provided. Although it previously set an empty string, None is consistent with the behavior of other fields. #355 ValueError raised by a validator are handled like regular exceptions. Validators need to raise validators.ValidationError or validators.StopValidation to make a validation fail. #445 fields.SelectField, fields.SelectMultipleField and fields.RadioField choices parameter can be a callable. #608 fields.core.SelectMultipleField. #603 #605 fields.core.MonthField. #530 #593 form.BaseForm.process takes a extra_filters parameter. #128 #592 fields.core.SelectField choices are list of strings. #598 fields.core.SelectMultipleField validate_choice bugfix. #606 #642 π Released 2020εΉ΄07ζ30ζ₯
641π Released 2020εΉ΄04ζ22ζ₯
wtforms.ext show a deprecation warning on import.
They will be removed in version 3.0.~fields.SelectField choices is None.
:issue:572, 585HTMLString and escape_html as aliases for
MarkupSafe functions. Their use shows a DeprecationWarning.
:issue:581, :pr:583Form.validate takes an extra_validators parameter, mapping
field names to lists of extra validator functions. This matches
BaseForm.validate. :pr:584π Released 2020εΉ΄04ζ21ζ₯
~fields.SelectField uses list() to construct a new list
of choices. :pr:475HostnameValidation. :pr:463~validators.URL validator now allows query parameters in
the URL. :issue:523, :pr:524false_values param in BooleanField docs.
:issue:483, :pr:485471506, 514433FieldList error list keeps entries in order for easier
identification of which fields had errors. :issue:257, :pr:407~validators.Length gives a more helpful error message when
min and max are the same value. :pr:266~fields.SelectField no longer coerces None to
"None" allowing use of "None" as an option. :issue:289,
:pr:288~widgets.TextArea widget prepends a \r\n newline
when rendering to account for browsers stripping an initial line for
display. This does not affect the value. :issue:238, :pr:395~fields.html5.IntegerField and
:class:~fields.html5.RangeInput don't render the step="1"
attribute by default. :pr:343aria_ args are rendered the same way as data_ args, by
converting underscores to hyphens. aria_describedby="name-help"
becomes aria-describedby="name-help". :issue:239, :pr:389check_validators method to :class:~fields.Field which
checks if the given validators are both callable, and not classes.
:pr:298, 410form.errors is not cached and will update if an error is
appended to a field after access. :pr:568~wtforms.validators.NumberRange correctly handle NaN
values. :issue:505, :pr:548~fields.IntegerField checks input type when processing
data. :pr:451~fields.SelectField to skip choice
validation. :issue:434, :pr:493526326, 409~widgets.core.escape_html is removed,
replaced by :func:markupsafe.escape.
:class:~widgets.core.HTMLString is removed, replaced by
:class:markupsafe.Markup. :pr:400ipaddress
package. :issue:385, :pr:403~fields.core.Label text is escaped before rendering.
:issue:315, :pr:375email_validator. :pr:429π Released on June 7th, 2018
~fields.StringField only 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, #401).. _#291: https://github.com/wtforms/wtforms/issues/291 .. _#401: https://github.com/wtforms/wtforms/issues/401
π Released on June 2nd, 2018
data_ args to render a field converts all the
underscores to hyphens when rendering the HTML attribute, not just
the first one. data_foo_bar becomes data-foo-bar. (#248_)~validators.UUID validator uses the :class:uuid.UUID
class instead of a regex. (#251_)~fields.SelectField copies the list of choices passed
to it so modifying an instance's choices will not modify the global
form definition. (#286_)~fields.Field.process_formdata even if the raw
data is empty. (#280_)~fields.MultipleFileField to handle a multi-file
input. :class:~fields.FileField continues to handle only one
value. The underlying :class:~widgets.FileInput widget gained a
multiple argument. (#281_)~fields.SelectField choices can contain HTML (MarkupSafe
Markup object or equivalent API) and will be rendered properly.
(#302_)~fields.TimeField and
:class:html5.TimeField <fields.html5.TimeField> were added.
(#254_)~validators.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_)required attribute when using a validator
that provides the 'required' flag, such as
:class:~validators.DataRequired. (#361_)~ext.sqlalchemy.fields.QuerySelectField to fail with
ValueError: too many values to unpack. (#391_).. _#248: https://github.com/wtforms/wtforms/pull/248 .. _#251: https://github.com/wtforms/wtforms/pull/251 .. _#254: https://github.com/wtforms/wtforms/pull/254 .. _#280: https://github.com/wtforms/wtforms/pull/280 .. _#281: https://github.com/wtforms/wtforms/pull/281 .. _#286: https://github.com/wtforms/wtforms/pull/286 .. _#294: https://github.com/wtforms/wtforms/pull/294 .. _#302: https://github.com/wtforms/wtforms/pull/302 .. _#361: https://github.com/wtforms/wtforms/pull/361 .. _#391: https://github.com/wtforms/wtforms/pull/391