Sorry Jorge, this one flew in under my radar. my vote is A.
B) is just annoying C) is what TurboJson/Sprox are for cheers. -chris On Jul 1, 1:52 pm, Jorge Vargas <[email protected]> wrote: > Hello, Just a quick reminder of this. Any opinions on it? if not I'll > choose option A > > > > On Sun, May 24, 2009 at 1:03 AM, Jorge Vargas<[email protected]> wrote: > > Hello Guys, > > > I just wanted to let you know I pushed the json stuff to tip[1], which > > has a minor backwards incompatibility with older quickstarts, if you > > upgrade you will see this error. > > > MissingRendererError: The renderer for 'json' templates is missing. > > Try adding the following line in you app_cfg.py: > > "base_config.renderers.append('json')" > > > which despite it's obviousness, someone asked me what's up? so read > > this and add that line. > > > I'll committed a patch so newer quickstart will have json on by > > default.[2] Please note this introduces a "broken" tests, see below. > > > My last question regarding this ends up at how permissive should it > > be. So far our json renderer will automagically render any object that > > - has __json__ and it's a callable > > - is of type date,datetime, Decimal, "Sqlalchemy class", SA result > > proxy, row proxy or. > > > now we have a final choice here > > a- make it call __repr__ and if that fails str(obj) > > b- make it fail with an error that the item is not "jsonable" > > c- make it a configurable option. > > > Currently the code implements "b" which is why the quickstart will > > fail at /environ.json because it doesn't knows how to render a "logger > > object", this is nice to catch errors But something you just want a > > quick valid json string, in which case "a" seems better. > > > [1]https://bitbucket.org/mramm/tg-21/changeset/bd8b45a54d91/to > >https://bitbucket.org/mramm/tg-21/changeset/0f59c4073032/ > > [2]https://bitbucket.org/mramm/tgdevtools/changeset/d924a5326f27/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
