Opened 12 years ago

Closed 12 years ago

Last modified 12 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


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 12 years ago.

Download all attachments as: .zip

Change History (4)

Changed 12 years ago by Chris Beaven

Attachment: apply_changes.patch added

comment:1 Changed 12 years ago by Chris Beaven

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:

comment:2 Changed 12 years ago by Adrian Holovaty

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 Changed 12 years ago by Adrian Holovaty

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/

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