From 51c36cffdf86f22a3a50549f459fe4b8e500db94 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 25 Nov 2018 04:02:00 -0800 Subject: Add section for notfound --- docs/tutorials/wiki/definingviews.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/tutorials') diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst index 3194d2df7..81ef4f5c4 100644 --- a/docs/tutorials/wiki/definingviews.rst +++ b/docs/tutorials/wiki/definingviews.rst @@ -251,6 +251,21 @@ If the view execution *is* a result of a form submission (if the expression ``'f It then redirects to the default view of the context (the page), which will always be the ``view_page`` view. +Modifying the ``notfound_view`` in ``notfound.py`` +-------------------------------------------------- + +We have one more view to modify. +Open ``tutorial/views/notfound.py`` and make the changes shown by the emphasized lines. + +.. literalinclude:: src/views/tutorial/views/notfound.py + :linenos: + :language: python + :emphasize-lines: 3-4, 9-12 + +We need to import the ``Page`` from our models. +We eventually return a ``Page`` object as ``page`` into the template ``layout.pt`` to display its name in the title tag. + + Adding templates ================ -- cgit v1.2.3