summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/definingviews.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-02-14 05:57:06 -0500
committerChris McDonough <chrism@plope.com>2012-02-14 05:57:06 -0500
commitc6a299ad7159ffcabe201fa79f485c388d837971 (patch)
treef4a5cec04ed8783516dadd646e2d0ccf41570fca /docs/tutorials/wiki2/definingviews.rst
parentc595946b859e48ea506dd3155da935eba10a1ed7 (diff)
downloadpyramid-c6a299ad7159ffcabe201fa79f485c388d837971.tar.gz
pyramid-c6a299ad7159ffcabe201fa79f485c388d837971.tar.bz2
pyramid-c6a299ad7159ffcabe201fa79f485c388d837971.zip
- Don't create a ``session`` instance in SQLA Wiki tutorial, use raw
``DBSession`` instead (this is more common in real SQLA apps).
Diffstat (limited to 'docs/tutorials/wiki2/definingviews.rst')
-rw-r--r--docs/tutorials/wiki2/definingviews.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/tutorials/wiki2/definingviews.rst b/docs/tutorials/wiki2/definingviews.rst
index bda0a2eb7..a067dbd66 100644
--- a/docs/tutorials/wiki2/definingviews.rst
+++ b/docs/tutorials/wiki2/definingviews.rst
@@ -126,7 +126,7 @@ HTML anchor for each *WikiWord* reference in the rendered HTML using a
compiled regular expression.
.. literalinclude:: src/views/tutorial/views.py
- :lines: 23-44
+ :lines: 23-43
:linenos:
:language: python
@@ -161,7 +161,7 @@ The ``matchdict`` attribute of the request passed to the ``add_page`` view
will have the values we need to construct URLs and find model objects.
.. literalinclude:: src/views/tutorial/views.py
- :lines: 46-58
+ :lines: 45-56
:linenos:
:language: python
@@ -184,7 +184,7 @@ If the view execution *is* a result of a form submission (if the expression
``'form.submitted' in request.params`` is ``True``), we scrape the page body
from the form data, create a Page object with this page body and the name
taken from ``matchdict['pagename']``, and save it into the database using
-``session.add``. We then redirect back to the ``view_page`` view for the
+``DBSession.add``. We then redirect back to the ``view_page`` view for the
newly created page.
The ``edit_page`` view function
@@ -197,7 +197,7 @@ request passed to the ``edit_page`` view will have a ``'pagename'`` key
matching the name of the page the user wants to edit.
.. literalinclude:: src/views/tutorial/views.py
- :lines: 60-73
+ :lines: 58-70
:linenos:
:language: python