10 lines
311 B
Python
10 lines
311 B
Python
# A JSON-based API(view) for your app.
|
|
# Most rules would look like:
|
|
# @jsonify.when("isinstance(obj, YourClass)")
|
|
# def jsonify_yourclass(obj):
|
|
# return [obj.val1, obj.val2]
|
|
# @jsonify can convert your objects to following types:
|
|
# lists, dicts, numbers and strings
|
|
|
|
from turbojson.jsonify import jsonify
|
|
|