diff options
| author | Michael Merickel <michael@merickel.org> | 2016-04-27 21:01:28 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2016-04-27 21:01:28 -0500 |
| commit | f7d515de86ad1ceab1b330cf1d95257b712b2659 (patch) | |
| tree | e1e50f0616a5729357e52812c0d2dfe0ebe14764 /docs/designdefense.rst | |
| parent | 0a1f99d77f9fa1910c7439cc1824c19e81cddf02 (diff) | |
| download | pyramid-f7d515de86ad1ceab1b330cf1d95257b712b2659.tar.gz pyramid-f7d515de86ad1ceab1b330cf1d95257b712b2659.tar.bz2 pyramid-f7d515de86ad1ceab1b330cf1d95257b712b2659.zip | |
fix bugs in design defense code examples
fixes #2287
Diffstat (limited to 'docs/designdefense.rst')
| -rw-r--r-- | docs/designdefense.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 3c1046b82..70dbbe720 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -1297,12 +1297,12 @@ Consider the following simple `Groundhog from groundhog import Groundhog app = Groundhog('myapp', 'seekrit') - app.route('/admin') + @app.route('/admin') def admin(): return '<html>admin page</html>' - app.route('/:action') - def action(): + @app.route('/:action') + def do_action(action): if action == 'add': return '<html>add</html>' if action == 'delete': @@ -1322,15 +1322,15 @@ order of the function definitions in the file? from groundhog import Groundhog app = Groundhog('myapp', 'seekrit') - app.route('/:action') - def action(): + @app.route('/:action') + def do_action(action): if action == 'add': return '<html>add</html>' if action == 'delete': return '<html>delete</html>' return app.abort(404) - app.route('/admin') + @app.route('/admin') def admin(): return '<html>admin page</html>' |
