summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2014-08-29 10:22:59 +0200
committerClaude Paroz <claude@2xlibre.net>2014-08-29 10:24:50 +0200
commit909015a51b98749cabb0d13f8ea0bf58ec707fa3 (patch)
tree128f815b730eb6828b07642e635314deaa3bbc7a /docs
parente98c5513cb63ea8e1db28a3ea01b157fb11dfed1 (diff)
Fixed #22786 -- Documented value_from_datadict caveat
Thanks blueyed for the report and Tim Graham for the review.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/forms/widgets.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt
index a2245a5ffa..242a77110f 100644
--- a/docs/ref/forms/widgets.txt
+++ b/docs/ref/forms/widgets.txt
@@ -230,7 +230,12 @@ foundation for custom widgets.
.. method:: value_from_datadict(data, files, name)
Given a dictionary of data and this widget's name, returns the value
- of this widget. Returns ``None`` if a value wasn't provided.
+ of this widget. ``files`` may contain data coming from
+ :attr:`request.FILES <django.http.HttpRequest.FILES>`. Returns ``None``
+ if a value wasn't provided. Note also that ``value_from_datadict`` may
+ be called more than once during handling of form data, so if you
+ customize it and add expensive processing, you should implement some
+ caching mechanism yourself.
.. class:: MultiWidget(widgets, attrs=None)