[web2py] Re: Problem passing a json object to controller

2019-11-20 Thread Paco Bernal
H again :) I think the problem is this Instead of request.vars.items[json1] > use this request.vars['items[json1]'] > because the var is 'items[json1]' requests.vars.items[json1] will look for the key 'json1' in the dict var items and there is no items var only a 'items[json1]' var

[web2py] Re: Problem passing a json object to controller

2019-11-20 Thread Patito Feo
Paco here is the reponse: 1. {vars: {…}, respuesta: "noexiste"} 1. respuesta: "noexiste" 2. vars: {tarea: "solicitudguardar", items[json1]: "[1,2,3]"} 3. __proto__: Object Thanks in advance, El miércoles, 20 de noviembre de 2019, 16:39:22 (UTC-5), Paco Bernal

[web2py] Re: Problem passing a json object to controller

2019-11-20 Thread Paco Bernal
Hi, Try this, write down at the begin of the controller print request.vars > you will see how the controller receives the information and then you will know if it's a js problem or a server side problem. with your code what the controller receives is

Re: [web2py] Problem passing a json object to controller

2019-11-20 Thread Patito Feo
Javier, Tested and not working. 'builtin_function_or_method' object has no attribute '__getitem__' request.post_vars Any ideas? Thanks for your reply, El miércoles, 20 de noviembre de 2019, 12:35:38 (UTC-5), Javier Pepe escribió: > > You need use: > >var = json.loads (

Re: [web2py] Problem passing a json object to controller

2019-11-20 Thread Javier Pepe
You need use: var = json.loads ( request.post_vars.items[*"*json1*"*] ) El mié., 20 de nov. de 2019 a la(s) 14:08, Patito Feo ( patitofeo...@gmail.com) escribió: > Hi, > > Ive been trying to pass an object with keys to the controller. But i > havent been able to extract the request.vars. >

[web2py] Problem passing a json object to controller

2019-11-20 Thread Patito Feo
Hi, Ive been trying to pass an object with keys to the controller. But i havent been able to extract the request.vars. Here is my view: var Cars = {} Cars.make = 'Ford'; Cars.model = 'Mustang'; Cars.year = 1969; $.post( "{{=URL('default', 'transcriptor')}}", //request.post_vars.json1 {