I use a combination of this. A __json__ method on Base, and a custom json
renderer, taking this method into account.
Regards
Robert

Am 01.03.2012 15:34 schrieb "Cosmia Luna" <[email protected]>:

> I want to to return some SQLAlchemy object to the json renderer, of course
> it didn't work.
> Can I add a method to the Base like:
>
> class Base(object):
>     def __jsonSerialize__(self):
>         pass # return a dict-like object
>
> Base=declarative_base(cls=Base)
>
> Or I have to write a renderer called ejson(extendable json renderer) or
> some other wrapping the default json renderer?
>
> Thanks,
> Cosmia
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pylons-discuss/-/GW86sjghplgJ.
> 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/pylons-discuss?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to