On 11/11/06, iain duncan <[EMAIL PROTECTED]> wrote:
>
> > > > Well, JavaScript iterates over objects the exact same way that Python
> > > > iterates over dicts ;)
> > >
> > > Does that mean that if you want to use ajax to keep essentially mirrors
> > > of your object on the server and the client end, a python dictionary is
> > > the best way to go? Sub class a dictionary?
> >
> > That's pretty much irrelevant. Subclassing dict is generally a bad idea 
> > though.
>
> I guess my confusion is with how we return things from the controller,
> how they get to become json, and how we should take them apart. Any
> pointers on good docs on this topic?

Most solid doc on this topic is:

http://docs.turbogears.org/1.0/GettingStarted/JSON

You can explicitly control how objects are converted to json using the
jsonify decorator. There's an example in the json.py file created by
quickstart. I have not fully explored jsonify (it was added during one
of my periodic breaks from TG), so I haven't written a reference
jsonify doc.

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to