On Sat, Feb 14, 2009 at 11:19 AM, Jorge Vargas <jorge.var...@gmail.com> wrote: > On Sat, Feb 14, 2009 at 8:45 AM, Mark Ramm <mark.mchristen...@gmail.com> > wrote: >> >> On Fri, Feb 13, 2009 at 11:35 PM, percious <ch...@percious.com> wrote: >>> >>> Personally I think we should default to SimpleJson, and then if the >>> user has TurboJson installed, we should >>> default to that. It should be simple enough to put a switch in >>> config. >>> >>> try: >>> import turbojson >>> except: >>> import simplejson >>> >>> or such. >>> >>> I feel that for simple jsonifications (dictionaries) SJ will be >>> enough. >> > I think a better solution, given our time constraints and backwards > compatibility, is to create a new config flag 'use_turbojson' which > defaults to True with a comment that False will be the default in > tg2.1, then in the code, build a new render_json function and replace > the check for legacy renders. So in practice we'll have the same > legacy renders but only the json legacy render will be on by default. > >> But it is extraordinarily likely that SQLAlchemy objects will be >> returned by the controller, and those are not simple dictionaries. > > with time this will be grown into render_json, in fact I think it can > have that by default as well as the dict, and respect the __json__, > that should cover 80% of the use cases. > > I'll write a patch for the above suggestion. > OK I made a ticket and I have a rough first version of this. (1 error and 1 failure in tests) but i haven't tested it with SA classes.
http://trac.turbogears.org/attachment/ticket/2212 I'll realllly like this to go in. I'm willing to code a flag (use_turbojson) which will default to True, and keep it as a dependency. But if we can get people to test most existing apps with use_turbojson = False and get render_json well tested I'll like to release tg2.0final with it turned off. pretty please :p --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to turbogears-trunk@googlegroups.com To unsubscribe from this group, send email to turbogears-trunk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---