summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTimo Graham <timograham@gmail.com>2010-12-26 21:51:51 +0000
committerTimo Graham <timograham@gmail.com>2010-12-26 21:51:51 +0000
commitb1487c499b4dcf46a5316baf0cfb31bf9737d671 (patch)
treeb731f2b3bda18d0f0f93f4d802a758063fa38843 /docs
parent79e64d7cff1fd8e1283689406ea6ddde159ba8ef (diff)
[1.2.X] Fixed #13949 - Note that readonly fields can't be modified via custom clean methods. thanks alk for the suggestion and elbarto and Gabriel Hurley whose language I used in the final patch.
Backport of r15060 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15061 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/forms/index.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/topics/forms/index.txt b/docs/topics/forms/index.txt
index a860e89e43..09d3cbb041 100644
--- a/docs/topics/forms/index.txt
+++ b/docs/topics/forms/index.txt
@@ -139,7 +139,11 @@ While you could access ``request.POST`` directly at this point, it is better to
access ``form.cleaned_data``. This data has not only been validated but will
also be converted in to the relevant Python types for you. In the above example,
``cc_myself`` will be a boolean value. Likewise, fields such as ``IntegerField``
-and ``FloatField`` convert values to a Python int and float respectively.
+and ``FloatField`` convert values to a Python int and float respectively. Note
+that read-only fields are not available in ``form.cleaned_data`` (and setting
+a value in a custom ``clean()`` method won't have any effect) because these
+fields are displayed as text rather than as input elements, and thus are not
+posted back to the server.
Extending the above example, here's how the form data could be processed:
@@ -395,5 +399,5 @@ This covers the basics, but forms can do a whole lot more:
.. seealso::
:doc:`The Forms Reference </ref/forms/index>`
- Covers the full API reference, including form fields, form widgets,
+ Covers the full API reference, including form fields, form widgets,
and form and field validation.