#4271: Form should use a copy of data passed to it
------------------------------------------------+---------------------------
Reporter: Gary Wilson <[EMAIL PROTECTED]> | Owner: adrian
Status: new | Component: django.newforms
Version: SVN | Keywords:
Stage: Unreviewed | Has_patch: 0
------------------------------------------------+---------------------------
Usually, one passes POST data directly to the form like so:
{{{
#!python
if request.method == 'POST':
form = MyForm(request.POST)
}}}
and request.POST is an immutable QueryDict. This means that you cannot
fiddle with the data, for say if you wanted to remove keys so that the
data doesn't get redisplayed when the form has errors.
I could make the copy in my own code:
{{{
#!python
form = MyForm(request.POST.copy())
}}}
but just thought this might be something useful to do more generally.
If anyone has a better alternative for not redisplaying submitted data,
please mention it.
--
Ticket URL: <http://code.djangoproject.com/ticket/4271>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---