[patch] Make newforms.models.save_instance work with a subset of model fields
|Reported by:||Owned by:||Adrian Holovaty|
|Cc:||alex@…||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
The save_instance() function in newforms.models expects clean_data to have a key/value pair for every field in the model. This needlessly limits one from using a form to update only part of a model.
The attached patch adds a check that the field name is in the clean_data dict before modifying an instance's value for that field.
Change History (9)
comment:1 Changed 10 years ago by
|Triage Stage:||Unreviewed → Accepted|