Django

Code

Changeset 6148

Show
Ignore:
Timestamp:
09/13/07 20:45:26 (1 year ago)
Author:
mtredinnick
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/AUTHORS

    r6141 r6148  
    242242    Michael Radziej <mir@noris.de> 
    243243    Amit Ramon <amit.ramon@gmail.com> 
     244    Philippe Raoult <philippe.raoult@n2nsoft.com> 
    244245    Massimiliano Ravelli <massimiliano.ravelli@gmail.com> 
    245246    Brian Ray <http://brianray.chipy.org/> 
  • django/trunk/docs/newforms.txt

    r6142 r6148  
    19171917this example has an ``else`` clause that implements the default behavior. 
    19181918 
     1919.. warning:: 
     1920    The field that is passed into the ``formfield_callback`` function in 
     1921    ``form_for_model()`` and ``form_for_instance`` is the field instance from 
     1922    your model's class. You **must not** alter that object at all; treat it 
     1923    as read-only! 
     1924 
     1925    If you make any alterations to that object, it will affect any future 
     1926    users of the model class, because you will have changed the field object 
     1927    used to construct the class. This is almost certainly what you don't want 
     1928    to have happen. 
     1929 
    19191930Finding the model associated with a form 
    19201931~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~