we choose an unfortunate name for gluon.serializers.json I can see how that
can create confusion.
On Saturday, 21 February 2015 06:03:24 UTC-6, clara wrote:
>
> Hello all,
>
> Massimo, I tried the same, I saved request.vars.input into a file and
> tried:from a python console:imported json and js
Hello all,
Massimo, I tried the same, I saved request.vars.input into a file and
tried:from a python console:imported json and json.loads worked fine. You
nailed the problem: I imported the wrong json module:
I changed the imports from:
*from gluon.serializers import json*
to:
*from gluon.cont
Clara,
May it be possible that specifying datatype in your ajax call be the
poblem? You stringify if then you say that it is an json type to ajax...
I would try by removing the datatyep: 'json' line completly in the above
and see if request.vars.input is now a plain string of the json you
stringi
I tried this
>>> data = '{"input":[{"the_owner":1,"category":1,"name":"La marcha del
oro","price":44.45,"id":1,"quantity":100},{"the_owner":3,"category":3,"name":"Toy
Story","price":34.56,"id":2,"quantity":23},{"the_owner":2,"category":2,"name":"La
Sirenita","price":56.67,"id":3,"quantity":10
Hello all,
Thanks all for the responses and sorry for the delay in my response. I was
struggling with this and I don't get to solve it yet. The data (string)
passed to the controller as *request.vars.input *looks good but it fails
when I try to load it with json.loads.
This is what I have at
Clara I'd suggest to use the full json service support of web2py, makes
everything easier
do the following:
make sure you have the call() method you can find in default.py controller
of welcome application
then write a method like this in default.py:
def dothetest():
return dict()
@service.
No a list of python dict
:)
Richard
On Fri, Feb 20, 2015 at 1:27 PM, Derek wrote:
> It doesn't appear to be a string object anymore, you have a python
> dictionary object.
> Try this..
>
> print type(request.vars.input)
>
>
> On Friday, February 20, 2015 at 11:19:55 AM UTC-7, clara wrote:
>>
>
but what is :
print 'request.vars.input'??
To me it should print : "request.vars.input"
hein!!
Clara would you copy/paste your exact code here?
Richard
On Fri, Feb 20, 2015 at 2:00 PM, Richard Vézina wrote:
> No a list of python dict
>
> :)
>
> Richard
>
> On Fri, Feb 20, 2015 at 1:27 PM,
It doesn't appear to be a string object anymore, you have a python
dictionary object.
Try this..
print type(request.vars.input)
On Friday, February 20, 2015 at 11:19:55 AM UTC-7, clara wrote:
>
> Hello,
>
> I am making an Ajax call and calling a controller with the json data I
> need to proces
9 matches
Mail list logo