yes, i was double-encoding. thanks :)

also because I was encoding python dicts and not php arrays (like in the
dynamictable example) I had to change:

class_name = @{{obj}}["__jsonclass__"][0]

to

> class_name = @{{obj}}["__jsonclass__"]


in jsObjectToPyObject() from json.py

not sure if that screws anything up, but it seems to be working fine so
far..

On Tue, Feb 28, 2012 at 10:47 PM, lkcl luke <[email protected]> wrote:

> On Tue, Feb 28, 2012 at 11:41 PM, Rahul Rajan <[email protected]>
> wrote:
> > To simplify it part a) of my previous email:
> >
> >> def tester(d):
> >>   Window.alert("YAY")
> >>     inst = 'yay'
> >>     return inst
> >
> >
> >> from json import loads
> >>
> >> bar = loads('["foo", {"bar":["baz", null, 1.0, 2]}]',
> >> object_hook=tester) self.mainPanel.add(HTML(bar))
> >
> >
> > On the browser:
> >>
> >> ['foo', {'bar': ['baz', None, 1, 2]}]
> >
> >
> > It looks like loads works, but the object_hook parameter does not. I can
> see
> > the tester function being mapped in the browser debugger. But I am not
> sure
> > where it breaks. its kind of hard to follow whats going on. Just
> wondering
> > if we are going down the right path here..
>
>  1) make the full source code available so that we can see what's
> really going on
>
>  2) take a look at library/pyjamas/JSONService.browser.py and
> library/pyjamas/JSONService.py
>
>  object recreation is automatic, but you appear to be double-encoding the
> data.
>
>  l.

Reply via email to