diff options
| author | Tim Graham <timograham@gmail.com> | 2016-09-30 14:49:50 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-09-30 14:50:15 -0400 |
| commit | f23c03ebc81c64b8b41f3aae0dbe93fc283cc43d (patch) | |
| tree | d6d9afa244a745ff7ebe0267abf0ba67ef593f8d /docs | |
| parent | fb9f3962756ed80ec8ecec8ec2095ee6bca49efd (diff) | |
[1.10.x] Refs #27186 -- Fixed model form default fallback for CheckboxSelectMultiple.
Backport of 87c5e7efebd040aef0f0479ccf86877155bb5cea from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/forms/widgets.txt | 9 | ||||
| -rw-r--r-- | docs/releases/1.10.2.txt | 8 | ||||
| -rw-r--r-- | docs/topics/forms/modelforms.txt | 3 |
3 files changed, 11 insertions, 9 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index fde7806b02..443b12cce0 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -281,10 +281,11 @@ foundation for custom widgets. The method's result affects whether or not a field in a model form :ref:`falls back to its default <topics-modelform-save>`. - A special case is :class:`~django.forms.CheckboxInput`, which always - returns ``False`` because an unchecked checkbox doesn't appear in the - data of an HTML form submission, so it's unknown whether or not the - user actually submitted a value. + Special cases are :class:`~django.forms.CheckboxInput` and + :class:`~django.forms.CheckboxSelectMultiple`, which always return + ``False`` because an unchecked checkbox doesn't appear in the data of + an HTML form submission, so it's unknown whether or not the user + actually submitted a value. ``MultiWidget`` --------------- diff --git a/docs/releases/1.10.2.txt b/docs/releases/1.10.2.txt index 075eb947f9..78447dccba 100644 --- a/docs/releases/1.10.2.txt +++ b/docs/releases/1.10.2.txt @@ -18,10 +18,10 @@ Bugfixes * Disabled system check for URL patterns beginning with a '/' when ``APPEND_SLASH=False`` (:ticket:`27238`). -* Fixed model form ``default`` fallback for ``MultiWidget``, ``FileInput``, - ``SplitDateTimeWidget``, ``SelectDateWidget``, and ``SplitArrayWidget`` - (:ticket:`27186`). Custom widgets affected by this issue may need to - implement a :meth:`~django.forms.Widget.value_omitted_from_data` method. +* Fixed model form ``default`` fallback for ``CheckboxSelectMultiple``, + ``MultiWidget``, ``FileInput``, ``SplitDateTimeWidget``, ``SelectDateWidget``, + and ``SplitArrayWidget`` (:ticket:`27186`). Custom widgets affected by this + issue should implement :meth:`~django.forms.Widget.value_omitted_from_data`. * Fixed a crash in ``runserver`` logging during a "Broken pipe" error (:ticket:`27271`). diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt index 3d5bc746fe..768dc3938c 100644 --- a/docs/topics/forms/modelforms.txt +++ b/docs/topics/forms/modelforms.txt @@ -335,7 +335,8 @@ doesn't validate -- i.e., if ``form.errors`` evaluates to ``True``. If an optional field doesn't appear in the form's data, the resulting model instance uses the model field :attr:`~django.db.models.Field.default`, if there is one, for that field. This behavior doesn't apply to fields that use -:class:`~django.forms.CheckboxInput` (or any custom widget whose +:class:`~django.forms.CheckboxInput` and +:class:`~django.forms.CheckboxSelectMultiple` (or any custom widget whose :meth:`~django.forms.Widget.value_omitted_from_data` method always returns ``False``) since an unchecked checkbox doesn't appear in the data of an HTML form submission. Use a custom form field or widget if you're designing an API |
