Mercurial > genshi > mirror
view examples/turbogears/genshitest/json.py @ 262:bbabcbb6378f trunk
Prepare [milestone:0.3.1] release.
author | cmlenz |
---|---|
date | Fri, 22 Sep 2006 13:34:03 +0000 |
parents | 84168828b074 |
children |
line wrap: on
line source
# This module provides helper functions for the JSON part of your # view, if you are providing a JSON-based API for your app. # Here's what most rules would look like: # @jsonify.when("isinstance(obj, YourClass)") # def jsonify_yourclass(obj): # return [obj.val1, obj.val2] # # The goal is to break your objects down into simple values: # lists, dicts, numbers and strings from turbojson.jsonify import jsonify