~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/json.py

  • Committer: Guillermo Gonzalez
  • Date: 2008-09-09 03:47:24 UTC
  • mto: (217.1.9 logging)
  • mto: This revision was merged to the branch mainline in revision 226.
  • Revision ID: guillo.gonzo@gmail.com-20080909034724-dm7wj8yf22y86fkh
 * new apps module: "error" and ErrorHandlerApp middleware
 * new error_ui controller 
 * added trivial template: error.pt
 * serve-branches:
  - added --log-folder option
  - reorganized logging setup (as first step towards move it into trace.py)
 * exception handling in BranchWSGIApp.app 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This module provides helper functions for the JSON part of your
2
 
# view, if you are providing a JSON-based API for your app.
3
 
 
4
 
# Here's what most rules would look like:
5
 
# @jsonify.when("isinstance(obj, YourClass)")
6
 
# def jsonify_yourclass(obj):
7
 
#     return [obj.val1, obj.val2]
8
 
# The goal is to break your objects down into simple values:
9
 
# lists, dicts, numbers and strings
10
 
 
11
 
from turbojson.jsonify import jsonify
12