summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-09-06 17:41:54 -0400
committerTim Graham <timograham@gmail.com>2016-09-22 13:07:23 -0400
commit0b59ea3343ef6f035064cfae1608f54c5a3fd147 (patch)
tree81a3499027dd1397d6345a518c4b4cba8e5a1cdd /docs/ref
parent190cd0e49f967d2ec0b6c50a63f0d58d13319611 (diff)
[1.10.x] Fixed #27186 -- Fixed model form default fallback for MultiWidget, FileInput, SplitDateTimeWidget, SelectDateWidget, and SplitArrayWidget.
Thanks Matt Westcott for the review. Backport of 3507d4e773aa9ff2336e7230ba231c4ba6eb568f from master
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/forms/widgets.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt
index 0bc23aab66..fde7806b02 100644
--- a/docs/ref/forms/widgets.txt
+++ b/docs/ref/forms/widgets.txt
@@ -271,6 +271,21 @@ foundation for custom widgets.
customize it and add expensive processing, you should implement some
caching mechanism yourself.
+ .. method:: value_omitted_from_data(data, files, name)
+
+ .. versionadded:: 1.10.2
+
+ Given ``data`` and ``files`` dictionaries and this widget's name,
+ returns whether or not there's data or files for the widget.
+
+ 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.
+
``MultiWidget``
---------------