On Mar 6, 9:51 am, gazza <[email protected]> wrote:
> Hello,
>
> I am redirecting to a URL and want to pass data to the URL I was doing
> something like:
>
> c.source = "Gazza"
> return redirect(path)
>
> It does get redirected to the correct page, however I dont see the
> value on html
>
> ${c.source} being displayed.
>
> Can I use c objects with a redirect or is this specific to render?

The issue here is that when you do a redirect, whether to an action in
your Pylons app or to an external URL, all of the current request/
thread state is tossed out (in a manner of speaking).

You can use `session` to save data across requests. In some cases, URL
params might suffice. Do something like:

    request(url('/my/path', source='Gazza'))

or

    session['source'] = 'Gazza'
    session.save()
    # ...
    # In action accessed via /my/path
    if 'source' in session:
        source = session.pop('source')
        "do something"

The right approach really depends on what you're trying to do, but
hopefully this will point you in a useful direction.

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

Reply via email to