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.
--
Best regards,
Antipin Aleksei
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