summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/basiclayout.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-12-10 12:29:30 -0800
committerChris McDonough <chrism@plope.com>2012-12-10 12:29:30 -0800
commit551ac9d57471868f901b928df085b205a18db658 (patch)
tree5edd4034c84eec75882dc09cbe33f0873cbbe679 /docs/tutorials/wiki2/basiclayout.rst
parenta078e197d04400d2430206fe31e3398c761b20a3 (diff)
parent95a0b80ed0eefae151d00043f85d94534a256b89 (diff)
downloadpyramid-551ac9d57471868f901b928df085b205a18db658.tar.gz
pyramid-551ac9d57471868f901b928df085b205a18db658.tar.bz2
pyramid-551ac9d57471868f901b928df085b205a18db658.zip
Merge pull request #738 from ppaez/pep8_scaffolds
Improve pep8 compliance of scaffolds
Diffstat (limited to 'docs/tutorials/wiki2/basiclayout.rst')
-rw-r--r--docs/tutorials/wiki2/basiclayout.rst18
1 files changed, 8 insertions, 10 deletions
diff --git a/docs/tutorials/wiki2/basiclayout.rst b/docs/tutorials/wiki2/basiclayout.rst
index 4f73dc914..934bfb52a 100644
--- a/docs/tutorials/wiki2/basiclayout.rst
+++ b/docs/tutorials/wiki2/basiclayout.rst
@@ -51,15 +51,14 @@ The main function first creates a SQLAlchemy database engine using
(something like ``sqlite://``):
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 12
- :linenos:
+ :lines: 13
:language: py
``main`` then initializes our SQLAlchemy session object, passing it the
engine:
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 13
+ :lines: 14
:language: py
``main`` subsequently initializes our SQLAlchemy declarative Base object,
@@ -71,13 +70,13 @@ forgotten about this tutorial, you won't be left scratching your head when it
doesn't work.
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 14
+ :lines: 15
:language: py
The next step of ``main`` is to construct a :term:`Configurator` object:
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 15
+ :lines: 16
:language: py
``settings`` is passed to the Configurator as a keyword argument with the
@@ -90,7 +89,7 @@ deployment-related values such as ``pyramid.reload_templates``,
two arguments: ``static`` (the name), and ``static`` (the path):
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 16
+ :lines: 17
:language: py
This registers a static resource view which will match any URL that starts
@@ -108,7 +107,7 @@ via the :meth:`pyramid.config.Configurator.add_route` method that will be
used when the URL is ``/``:
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 17
+ :lines: 18
:language: py
Since this route has a ``pattern`` equalling ``/`` it is the route that will
@@ -121,7 +120,7 @@ view configuration will be registered, which will allow one of our
application URLs to be mapped to some code.
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 18
+ :lines: 19
:language: py
Finally, ``main`` is finished configuring things, so it uses the
@@ -129,7 +128,7 @@ Finally, ``main`` is finished configuring things, so it uses the
:term:`WSGI` application:
.. literalinclude:: src/basiclayout/tutorial/__init__.py
- :lines: 19
+ :lines: 20
:language: py
View Declarations via ``views.py``
@@ -201,7 +200,6 @@ Next we set up a SQLAlchemy "DBSession" object:
.. literalinclude:: src/basiclayout/tutorial/models.py
:lines: 16
- :linenos:
:language: py
``scoped_session`` and ``sessionmaker`` are standard SQLAlchemy helpers.