Changeset 3758
- Timestamp:
- 09/14/06 08:31:50 (2 years ago)
- Files:
-
- django/trunk/docs/forms.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/forms.txt
r3475 r3758 322 322 errors = {} 323 323 # This makes sure the form accurate represents the fields of the place. 324 new_data = place.__dict__324 new_data = manipulator.flatten_data() 325 325 326 326 form = forms.FormWrapper(manipulator, new_data, errors) … … 337 337 object being edited. 338 338 339 * We set ``new_data`` to the original object's ``__dict__``. This makes340 sure the form fields contain the current values of the object.341 ``FormWrapper`` does not modify ``new_data`` in any way, and templates342 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. 343 343 344 344 * The above example uses a different template, so create and edit can be
