From 435e5fa34a6a87129f6922c18fa36e26d60e4e7f Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Tue, 17 Sep 2013 17:33:32 -0400 Subject: Replace simplegeneric with singledispatch (PEP 443). Closes-Bug: #1226813 Change-Id: I1ba149ac00353460065d4cddbe3ccd8782aaa611 --- docs/source/jsonify.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'docs') 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 `_ 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, -- cgit v1.2.1