[sqlalchemy] Re: Sub-classing declarative classes

2014-06-14 Thread Jonathan Vanasco
for what it's worth... if you use simplejson instead of json (many people do), there is a 'for_json' kwarg in the encoder... If *for_json* is true (not the default), objects with a for_json() method will use the return value of that method for encoding as JSON instead of the object. so y

[sqlalchemy] Re: Sub-classing declarative classes

2014-06-14 Thread Noah Davis
Thanks, both of you. That gives me even more to consider. The problem I'm trying to solve is one of application-specific logic. For example, if the model is used in a Pyramid app, having a __json__() method on each ORM object would be very useful. At the same time, a desktop application won't h