On Tue, 3 Apr 2007 at 12:53, George Sakkis wrote:
> Ok, I see. So the way I now handle it is by checking if
> cherrypy.request.params.get('tg_format') == 'json' and return the
> appropriate dict. Kind of kludge but works for now.
Fortunately, that is an unneeded kludge :)
Take a look at the json.py file in your quickstart directory. You can
do something like:
@jsonify.when('isinstance(obj, YourClass)')
def jsonify_YourClass(obj):
return <your appropriate dict>
--RDM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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?hl=en
-~----------~----~----~----~------~----~------~--~---