Thanks for the replies Rajesh and Bruno, they were very helpful!

On Jan 2, 3:18 pm, bruno desthuilliers <[email protected]>
wrote:
> # NB : Q&D, not tested
> def my_redirect_to(request, url):
>    qs = request.META.QUERY_STRING
>    if qs:
>       url = "%s?%s" % (url, qs)
>    return redirect_to(url)

Here's the solution I ended up with (it also forwards keyword args):

def redirect_to_with_query(request, url, **kwargs):
    query_string = request.META["QUERY_STRING"]
    if query_string:
        url = "%s?%s" % (url, query_string)
    return redirect_to(request, url, **kwargs)


Cheers,
Filipe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to