On Aug 6, 1:09 pm, Sławek Tuleja <slawek.tul...@gmail.com> wrote:
> HI everyone!
>
> Can I redirect to view with form passing few variables in POST method
> (request.POST) and showing them in the form? (i need this in admin
> action)
>
> for example this works:
> def add_mailing(self, request, queryset):
>         return HttpResponseRedirect('%s?subject=halo' % \
>                                         urlresolvers.reverse
> ('admin:tenders_mailing_add'))
>
> but this does not:
> def add_mailing(self, request, queryset):
>         post = request.POST.copy()
>         post.update({'subject': 'halo'})
>         request.POST = post
>         return HttpResponseRedirect(urlresolvers.reverse
> ('admin:tenders_mailing_add'))
>
> * subject is name of text field in a form

No, you can't do that - it's a limitation of http, not of Django. The
solution is to do as in your first example and send the parameters in
the GET, or to use the session to store them.
--
DR.
--~--~---------~--~----~------------~-------~--~----~
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