On May 12, 8:39 am, Antipin Aleksei <[EMAIL PROTECTED]> wrote:
> Hi
>
> Is there simple way to pass "c" to redirected page? For instance I set
> c.errorMsg, run redirect_to and show c.errorMsg in that page.
You can do something like this:
# somewhere in a controller/action:
session['errors'] = 'Unknown region: %s' % region_id
session.save()
redirect_to('/regions', **dict(params))
# in the controller/action you redirected to:
if 'errors' in session:
c.title = 'Error'
c.errors = session.pop('errors')
session.save() # gotta do this to actually remove 'errors'
from the session
You can see this in context here:
http://trac.bycycle.org/browser/apps/web/tripplanner/trunk/tripplanner/controllers/regions.py
HTH,
__wyatt
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---