summaryrefslogtreecommitdiff
path: root/docs/quick_tutorial/databases.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/quick_tutorial/databases.rst')
-rw-r--r--docs/quick_tutorial/databases.rst16
1 files changed, 9 insertions, 7 deletions
diff --git a/docs/quick_tutorial/databases.rst b/docs/quick_tutorial/databases.rst
index 7c019dbfc..580774163 100644
--- a/docs/quick_tutorial/databases.rst
+++ b/docs/quick_tutorial/databases.rst
@@ -53,8 +53,8 @@ Steps
.. note::
- We aren't yet doing ``python3.3 setup.py develop`` as we
- are changing it later.
+ We aren't yet doing ``$VENV/bin/python setup.py develop`` as we
+ will change it later.
#. Our configuration file at ``databases/development.ini`` wires
together some new pieces:
@@ -72,6 +72,7 @@ Steps
to initialize the database:
.. literalinclude:: databases/tutorial/initialize_db.py
+ :linenos:
#. Since ``setup.py`` changed, we now run it:
@@ -104,6 +105,7 @@ Steps
our ``databases/tutorial/views.py``:
.. literalinclude:: databases/tutorial/views.py
+ :linenos:
#. Our tests in ``databases/tutorial/tests.py`` changed to include
SQLAlchemy bootstrapping:
@@ -138,8 +140,8 @@ Let's start with the dependencies. We made the decision to use
``pyramid_tm`` and ``zope.sqlalchemy``. Why?
Pyramid has a strong orientation towards support for ``transactions``.
-Specifically, you can install a transaction manager into your app
-application, either as middleware or a Pyramid "tween". Then,
+Specifically, you can install a transaction manager into your
+application either as middleware or a Pyramid "tween". Then,
just before you return the response, all transaction-aware parts of
your application are executed.
@@ -149,7 +151,7 @@ aborts the transaction. This is a very liberating way to write code.
The ``pyramid_tm`` package provides a "tween" that is configured in the
``development.ini`` configuration file. That installs it. We then need
-a package that makes SQLAlchemy and thus the RDBMS transaction manager
+a package that makes SQLAlchemy, and thus the RDBMS transaction manager,
integrate with the Pyramid transaction manager. That's what
``zope.sqlalchemy`` does.
@@ -167,8 +169,8 @@ console script follows the pattern of being fed a configuration file
with all the bootstrapping. It then opens SQLAlchemy and creates the
root of the wiki, which also makes the SQLite file. Note the
``with transaction.manager`` part that puts the work in the scope of a
-transaction (as we aren't inside a web request where this is done
-automatically.)
+transaction, as we aren't inside a web request where this is done
+automatically.
The ``models.py`` does a little bit extra work to hook up SQLAlchemy
into the Pyramid transaction manager. It then declares the model for a