By the way, I've finally gotten around to writing a step-by-step tutorial/blog post about JSON-serialization for Pyramid + SQLAlchemy. The post is here: http://codelike.com/blog/2015/07/19/how-to-serialize-sqlalchemy-objects-to-json-in-pyramid/
and the Pyramid-project that accompanies the blog post can be found here: https://github.com/martinstein/json-example Hope that might be helpful to some people. Regards, Martin Am Montag, 8. Juni 2015 17:04:46 UTC+2 schrieb Jonathan Vanasco: > > > On Monday, June 8, 2015 at 5:23:03 AM UTC-4, Martin Stein wrote: >> >> @Jonathan: Probably you know this already, but have you seen the >> 'add_adapter' method for extending the pyramid JSON renderer? One of the >> first things I do when I start a new Pyramid-project is to add an adapter >> for datetime. >> > > IIRC, we started with add_adapter but quickly outgrew it. > > We have well over 10 different datatypes that need JSON overrides – and we > serialize a lot of data to JSON for caching, actual data storage, and > debugging in templates. > > Eventually, it made more sense for us to centralize and maintain all the > `py_2_json` and `json_2_py` functions in a single shared library file, and > just import that single interface throughout our code. > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/d/optout.
