Django

Code

Changeset 3758

Show
Ignore:
Timestamp:
09/14/06 08:31:50 (2 years ago)
Author:
russellm
Message:

Updated documentation for ChangeManipulators? to reflect use of flatten_data() rather than dict to populate form data.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/forms.txt

    r3475 r3758  
    322322            errors = {} 
    323323            # This makes sure the form accurate represents the fields of the place. 
    324             new_data = place.__dict__ 
     324            new_data = manipulator.flatten_data() 
    325325 
    326326        form = forms.FormWrapper(manipulator, new_data, errors) 
     
    337337      object being edited. 
    338338 
    339     * We set ``new_data`` to the original object's ``__dict__``. This makes 
    340       sure the form fields contain the current values of the object. 
    341       ``FormWrapper`` does not modify ``new_data`` in any way, and templates 
    342       cannot, so this is perfectly safe
     339    * We set ``new_data`` based upon ``flatten_data()`` from the manipulator. 
     340      ``flatten_data()`` takes the data from the original object under  
     341      manipulation, and converts it into a data dictionary that can be used  
     342      to populate form elements with the existing values for the object
    343343 
    344344    * The above example uses a different template, so create and edit can be