On 2/3/07, Damjan <[EMAIL PROTECTED]> wrote:
> The exmaple from Sergey Lipnevich seems to me more clean than what's
> implemented in the ticket #136.
>
> This is what he said on Nov 3 2006:
>
> > response = redirect_to(controller = '...', action = '...', id = '...')
> > # set cookie
> > return response
>
> Is this not possible?
It would appear that redirect_to does not return a response, but
rather raises an exception that is caught by some middleware:
def redirect_to(url):
raise httpexceptions.HTTPFound(url)
By the way, that reminds me of why I initially needed this
functionality. Sometimes during handling a request, I want to setup
"action results", i.e. a message to give to the user. I want to do
this regardless off whether I do a redirect or whatever. In the past,
I use to shove this stuff into the session, but I'm trying really hard
to stay sessionless for as long as possible. Hence, it makes sense to
put this stuff in a cookie. Clearly, the code that sets the action
results shouldn't know if you're doing a redirect, but it has to if
you're going to set a cookie. Now you can see my dilemma :)
Given the recent changes, I'm sure I can make it work.
Best Regards,
-jj
--
http://jjinux.blogspot.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---