view examples/turbogears/genshitest/json.py @ 655:b090bf737111

The `striptags` function now also removes HTML/XML-style comments. Closes #150. Thanks to Armin Ronacher for the report and suggested fix.
author cmlenz
date Thu, 22 Nov 2007 19:43:05 +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
Copyright (C) 2012-2017 Edgewall Software