2009/4/21 Margie <margierogin...@yahoo.com>:
>
> Can anyone advise me on what is the best way in the views.py code to
> return an HttpResponse that simply returns the user to the previous
> page they were on?
>
> For example, let's say that multiple different pages have a button
> that executes some code in views.py, but is not intended to actually
> take the user to a new page.  So after executing that code, I just
> want to redisplay the previous page they were looking at.
>
> On a slightly more complicated note, say multiple different pages have
> a button that executes some code and then does redirect the user to
> page 'foo'.  Now when the user clicks a 'submit' button on page
> 'foo',  I would like to take them back to wherever they were before
> they got to page 'foo'.
>
> How do others deal with this?
>
> Thanks
>

You can save the previous page in a session variable before making the
redirect and then use it in the foo page.

-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

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