you can pass it as var with a json dict then convert it back to a
python dict
from gluon.contrib import simplejson
a = {'a': 'foo', 'b': 'bar'}
redirect(URL(r=request,
f='scmView.html',vars=dict(mydict = simplejson.dumps(a))
def scmView():
a = simplejson.loads(request.vars.mydict) if request.vars.mydict else
{}
On Nov 10, 9:00 pm, mdipierro <[email protected]> wrote:
> URL generates a URL, it can only contains strings.
>
> On Nov 10, 1:50 pm, Tom Chang <[email protected]> wrote:
>
>
>
> > All,
>
> > I just realized that when I pass a hash variable to redirect, it will
> > get converted into a string? Is there a way I can pass a hash variable
> > via redirect?
>
> > for example,
> > redirect(URL(r=request,
> > f='scmView.html',vars=dict(scmResult=scmResult, a= a,
> > totalCm=totalCm,osPath=osPath,scmOUI=scmOUI,scmOUIName=scmOUIName)))
>
> > scmOUI and scmOUIName are string after the redirect and I verify that
> > by using type operation.
>
> > cheers,
> > tom