Hi all,

I am trying to use a ModelForm in a "sparse" way to edit instances,
i.e. I only render one of its fields (plus a submit button) in the
template for editing the corresponding field in the model. I would
have expected that fields not present in the POST data of the request
would be omitted when updating the model, but to my surprise these
fields are set to the empty string "" - even fields that have been
None/NULL before calling form.save().

Is there a way to get the desired behavior (simply omitting data not
present in the request)? Shouldn't this even be the default behavior?

I believe the issue is actually not constrained to ModelForms but
probably applies to all forms in general, but it would be especially
handy to use ModelForms in such a sparse way in some scenarios.

Regards,

Flo Ledermann
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to