On Thu, Jan 8, 2009 at 11:34 AM, Flo Ledermann
<lederm...@ims.tuwien.ac.at>wrote:

>
> Hi all,
>
> after some more thinking, the workaround I came up with is now:
>
> if form.is_valid():
>    for key in form.cleaned_data.keys():
>        if not key in request.POST: del form.cleaned_data[key]
>    form.save()
>
> This removes all values that are not found in the original request
> from the form data before saving. Is this the way the pro's in this
> group would do it?
>
> I could still see some demand to put this into the core form logic
> (controllable by a flag), what do you think?
>
> Best regards and shout outs to everyone using Django,
>

Is there some reason you are not simply using exclude in Meta for the form
to avoid having these fields present in the form at all:

http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form

?

Karen

--~--~---------~--~----~------------~-------~--~----~
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