Hi Zeynel,
Assuming webapp, how about:
if self.request.referrer == '/whatever':
self.redirect('/somespot')
elf self.request.referrer == '/other':
self.redirect('/aplace')
else:
self.redirect('/there')
Webapp's self.request is a WebOb request, so it is documented here:
http://pythonpaste.org/webob/reference.html#id1
Robert
On Mon, Jan 17, 2011 at 12:52, Zeynel <[email protected]> wrote:
> Hi,
>
> I just added a new page "/hot" to sort by number of votes to articles.
>
> VoteHandler handles the vote with
>
> item.vote +=1
> item.put()
> self.redirect("/newest")
>
> but now the new page "/hot" also refers to this VoteHandler.
>
> After writing the new vote to the database I need to redirect to
> either /hot or /newest depending on the referrer.
>
> I searched the group and stackoverflow
> http://stackoverflow.com/search?page=2&tab=relevance&q=redirect%20google%20app%20engine
> but I could not find the answer.
>
> Can anyone direct me to the right reference?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" 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/google-appengine?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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/google-appengine?hl=en.