Author: mtredinnick
Date: 2007-09-13 20:45:26 -0500 (Thu, 13 Sep 2007)
New Revision: 6148

Modified:
   django/trunk/AUTHORS
   django/trunk/docs/newforms.txt
Log:
Fixed #3922 -- Added a warning that fields passed to form_for_model callback 
function should not be modified. It's bad for your health. Thanks, Philippe 
Raoult.


Modified: django/trunk/AUTHORS
===================================================================
--- django/trunk/AUTHORS        2007-09-14 01:21:34 UTC (rev 6147)
+++ django/trunk/AUTHORS        2007-09-14 01:45:26 UTC (rev 6148)
@@ -241,6 +241,7 @@
     Jan Rademaker
     Michael Radziej <[EMAIL PROTECTED]>
     Amit Ramon <[EMAIL PROTECTED]>
+    Philippe Raoult <[EMAIL PROTECTED]>
     Massimiliano Ravelli <[EMAIL PROTECTED]>
     Brian Ray <http://brianray.chipy.org/>
     [EMAIL PROTECTED]

Modified: django/trunk/docs/newforms.txt
===================================================================
--- django/trunk/docs/newforms.txt      2007-09-14 01:21:34 UTC (rev 6147)
+++ django/trunk/docs/newforms.txt      2007-09-14 01:45:26 UTC (rev 6148)
@@ -1916,6 +1916,17 @@
 just the ones that you want to behave differently to the default. That's why
 this example has an ``else`` clause that implements the default behavior.
 
+.. warning::
+    The field that is passed into the ``formfield_callback`` function in
+    ``form_for_model()`` and ``form_for_instance`` is the field instance from
+    your model's class. You **must not** alter that object at all; treat it
+    as read-only!
+
+    If you make any alterations to that object, it will affect any future
+    users of the model class, because you will have changed the field object
+    used to construct the class. This is almost certainly what you don't want
+    to have happen.
+
 Finding the model associated with a form
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to