Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15060 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 38d60c394166367b9ec0782093784a0d4c2947ab 1 parent 4b2b2ed
Tim Graham authored December 26, 2010

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  docs/topics/forms/index.txt
8  docs/topics/forms/index.txt
@@ -139,7 +139,11 @@ While you could access ``request.POST`` directly at this point, it is better to
139 139
 access ``form.cleaned_data``. This data has not only been validated but will
140 140
 also be converted in to the relevant Python types for you. In the above example,
141 141
 ``cc_myself`` will be a boolean value. Likewise, fields such as ``IntegerField``
142  
-and ``FloatField`` convert values to a Python int and float respectively.
  142
+and ``FloatField`` convert values to a Python int and float respectively. Note
  143
+that read-only fields are not available in ``form.cleaned_data`` (and setting
  144
+a value in a custom ``clean()`` method won't have any effect) because these
  145
+fields are displayed as text rather than as input elements, and thus are not
  146
+posted back to the server.
143 147
 
144 148
 Extending the above example, here's how the form data could be processed:
145 149
 
@@ -390,5 +394,5 @@ This covers the basics, but forms can do a whole lot more:
390 394
 .. seealso::
391 395
 
392 396
     :doc:`The Forms Reference </ref/forms/index>`
393  
-        Covers the full API reference, including form fields, form widgets, 
  397
+        Covers the full API reference, including form fields, form widgets,
394 398
         and form and field validation.

0 notes on commit 38d60c3

Please sign in to comment.
Something went wrong with that request. Please try again.