OK first problem resolved... the log said:

"Expecting property name"

essentially in the string single and double quotes where inverted and the json string passed was incorrect.

s ="{'a': 1}" # <- incorrect
s = '{"a": 1}' # <- correct

But another quest remains: Why I get a string using request.vars when nothing about it is said in the manual?

http://web2py.com/book/default/chapter/04#request

   thank you

bye
    Manuele

Il 08/02/2011 12:56, Manuele Pesenti ha scritto:
Hi *,
I'm trying pass some variables from one one controller/function to another using the command:

URL(request.application, 'myControler', 'myFunction', vars=dict(myVar=myVar))

but when I call request.vars.myVar I get a string type object even if myVar was a dictionary. I cannot bypass this problem using the json library because it causes an early return of the function. I tried:

import gluon.contrib.simplejson as sj

myVar = request.vars.myVar
myVar = sj.loads(myVar)

and after that any command are not executed... any suggestion?

thank you in advance
Bye
    Manuele

Reply via email to