Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#3232 closed enhancement (fixed)

[patch] apply_changes for all forms

Reported by: Chris Beaven Owned by: Adrian Holovaty
Component: Forms Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It seems like the recently added apply_changes method (to form_for_instance) could be useful in other cases too if it was a bit more "open-minded".

Attachments (1)

apply_changes.patch (4.5 KB ) - added by Chris Beaven 18 years ago.

Download all attachments as: .zip

Change History (4)

by Chris Beaven, 18 years ago

Attachment: apply_changes.patch added

comment:1 by Chris Beaven, 18 years ago

No tests added, just updated the wording of the existing tests. It will need some new ones, but I just wanted to show Adrian my idea to see if it has merit for now.

See previous discussion: http://groups-beta.google.com/group/django-developers/browse_thread/thread/9e2ecc980f6efda/deaa492428135f20

comment:2 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [4300]) Fixed #3232 -- newforms: Added save_instance(), which saves a given bound form's clean_data into a given model instance with the same field names

comment:3 by Adrian Holovaty, 18 years ago

For the record, I took a different approach than the patch suggested. I wasn't comfortable with the default_instance bit of magic on the Form class, and I didn't like putting database-aware code in django/newforms/forms.py.

Note: See TracTickets for help on using tickets.
Back to Top