Django

Code

Ticket #3232 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] apply_changes for all forms

Reported by: SmileyChris Assigned to: adrian
Milestone: Component: Forms
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

apply_changes.patch (4.5 kB) - added by SmileyChris on 01/04/07 19:45:20.

Change History

01/04/07 19:45:20 changed by SmileyChris

  • attachment apply_changes.patch added.

01/04/07 19:47:38 changed by SmileyChris

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

01/08/07 23:49:47 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(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

01/08/07 23:52:14 changed by adrian

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.


Add/Change #3232 ([patch] apply_changes for all forms)




Change Properties
Action