mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #21397 -- Re-added flexibility to TypedChoiceField coercion
Thanks Elec for the report and Simon Charette for the review.
This commit is contained in:
@@ -375,7 +375,9 @@ For each field, we describe the default widget used if you don't specify
|
||||
|
||||
A function that takes one argument and returns a coerced value. Examples
|
||||
include the built-in ``int``, ``float``, ``bool`` and other types. Defaults
|
||||
to an identity function.
|
||||
to an identity function. Note that coercion happens after input
|
||||
validation, so it is possible to coerce to a value not present in
|
||||
``choices``.
|
||||
|
||||
.. attribute:: empty_value
|
||||
|
||||
|
||||
@@ -317,6 +317,10 @@ Forms
|
||||
return ``self.cleaned_data``. If it does return a changed dictionary then
|
||||
that will still be used.
|
||||
|
||||
* After a temporary regression in Django 1.6, it's now possible again to make
|
||||
:class:`~django.forms.TypedChoiceField` ``coerce`` method return an arbitrary
|
||||
value.
|
||||
|
||||
* :attr:`SelectDateWidget.months
|
||||
<django.forms.extras.widgets.SelectDateWidget.months>` can be used to
|
||||
customize the wording of the months displayed in the select widget.
|
||||
|
||||
Reference in New Issue
Block a user