diff options
| author | Steve Piercy <web@stevepiercy.com> | 2018-11-25 03:36:51 -0800 |
|---|---|---|
| committer | Steve Piercy <web@stevepiercy.com> | 2018-11-25 03:36:51 -0800 |
| commit | 047394ea8ee37fb9161e8dad7693e82112f40d31 (patch) | |
| tree | 12977e01e5b61f3f1b2430338fbcdd1959cfe742 /docs/tutorials/wiki | |
| parent | db221574993ace9ab0773fe746ff7ae35b474d41 (diff) | |
| download | pyramid-047394ea8ee37fb9161e8dad7693e82112f40d31.tar.gz pyramid-047394ea8ee37fb9161e8dad7693e82112f40d31.tar.bz2 pyramid-047394ea8ee37fb9161e8dad7693e82112f40d31.zip | |
Add import and return a Page object for the notfound view
Diffstat (limited to 'docs/tutorials/wiki')
| -rw-r--r-- | docs/tutorials/wiki/src/views/tutorial/views/notfound.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py index 728791d0a..214ec810e 100644 --- a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py +++ b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py @@ -1,7 +1,12 @@ from pyramid.view import notfound_view_config +from ..models import Page + @notfound_view_config(renderer='../templates/404.pt') def notfound_view(request): request.response.status = 404 - return {} + pagename = request.subpath + page = Page(pagename) + page.__name__ = pagename + return dict(page=page) |
