On Fri, Aug 24, 2007 at 02:33:07PM +0200, Tomasz Nazar wrote:
> Whatever variable attached to 'c', it is available in the template when
> rendered via 'render_response('x.tmpl')'.
>
> I often however use redirects 'h.redirect_to(another_action)' to reuse
> controller's code. And the 'c'-attached variables are not present in the
> redirected template.
Correct. A redirect issues a "Location:" header to be sent to the
browser and that concludes the current HTTP communication. The browser
will then start a new HTTP request with the new location.
> As I understand 'c' is always reset before any controller's action - what is
> not fun for me, as in my app one "user" request/click is often 2 (or more)
> Pylons controllers' actions, hence http redirects..
Without knowing your application I dare say that this sounds like you
are using redirect_to in the wrong places. If the application is
supposed to do multiple things when a user does a certain HTTP request
then why can't one controller's action do that alone?
> What other options instead of putting variables to http session does one have
> for passing variables through redirects?
The "session" dictionary.
Christoph
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---