Mercurial > genshi > genshi-test
view examples/turbogears/genshitest/json.py @ 275:7f24dd6fb904
Integrated `HTMLFormFiller` filter initially presented as a [wiki:FormFilling#Usingatemplatefilter recipe].
author | cmlenz |
---|---|
date | Sun, 01 Oct 2006 22:54:57 +0000 |
parents | 24757b771651 |
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