[google-appengine] Re: deserialize json to python object

2009-02-10 Thread livibetter
On Feb 10, 5:23 pm, Rein Petersen wrote: >     obj = simplejson.loads("{'id':'KS1-0','type':'activity','units': > 1,'priceper':450}") The string of JSON is wrapped with double quote. ( http://json.org/ ) This will work obj = simplejson.loads('{"id":"KS1-0","type":"activity","units": 1,"pricep

[google-appengine] Re: deserialize json to python object

2009-02-10 Thread Rein Petersen
Hey thanks for the reply - that was the problem. Thanks again :) On Feb 10, 4:41 am, livibetter wrote: > On Feb 10, 5:23 pm, Rein Petersen wrote: > > >     obj = simplejson.loads("{'id':'KS1-0','type':'activity','units': > > 1,'priceper':450}") > > The string of JSON is wrapped with double quot

[google-appengine] Re: deserialize json to python object

2009-02-10 Thread notsobad
I use this a=eval("{'id':'KS1-0','type':'activity','units':1,'priceper':450}") print a['type'] On Feb 10, 5:23 pm, Rein Petersen wrote: > what is wrong with this: > > from django.utils import simplejson > ... >     obj = simplejson.loads("{'id':'KS1-0','type':'activity','units': > 1,'priceper':4