summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRyan Petrello <lists@ryanpetrello.com>2013-09-17 17:33:32 -0400
committerRyan Petrello <lists@ryanpetrello.com>2013-09-22 21:14:26 -0400
commit435e5fa34a6a87129f6922c18fa36e26d60e4e7f (patch)
tree08d083d1160e95597c752e645d2200b79a988e48 /docs
parent09ea1274589d51104d89d2b325906aa0a36c181a (diff)
downloadpecan-435e5fa34a6a87129f6922c18fa36e26d60e4e7f.tar.gz
Replace simplegeneric with singledispatch (PEP 443).
Closes-Bug: #1226813 Change-Id: I1ba149ac00353460065d4cddbe3ccd8782aaa611
Diffstat (limited to 'docs')
-rw-r--r--docs/source/jsonify.rst6
1 files changed, 2 insertions, 4 deletions
diff --git a/docs/source/jsonify.rst b/docs/source/jsonify.rst
index ac06c30..b5c6053 100644
--- a/docs/source/jsonify.rst
+++ b/docs/source/jsonify.rst
@@ -9,9 +9,7 @@ JSON. To get started, create a file in your project called
``json.py`` and import it in your project's ``app.py``.
Your ``json`` module will contain a series of rules for generating
-JSON from objects you return in your controller, utilizing
-"generic" function support from the
-`simplegeneric <http://pypi.python.org/pypi/simplegeneric>`_ library.
+JSON from objects you return in your controller.
Let's say that we have a controller in our Pecan application which
we want to use to return JSON output for a :class:`User` object::
@@ -35,7 +33,7 @@ rule in your ``json.py``::
from pecan.jsonify import jsonify
from myproject import model
- @jsonify.when_type(model.User)
+ @jsonify.register(model.User)
def jsonify_user(user):
return dict(
name = user.name,