On Sat, Feb 14, 2009 at 8:45 AM, Mark Ramm <[email protected]> wrote:
>
> On Fri, Feb 13, 2009 at 11:35 PM, percious <[email protected]> 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.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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-trunk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to