summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/basiclayout.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorials/wiki2/basiclayout.rst')
-rw-r--r--docs/tutorials/wiki2/basiclayout.rst14
1 files changed, 3 insertions, 11 deletions
diff --git a/docs/tutorials/wiki2/basiclayout.rst b/docs/tutorials/wiki2/basiclayout.rst
index 98a14c644..233231f8d 100644
--- a/docs/tutorials/wiki2/basiclayout.rst
+++ b/docs/tutorials/wiki2/basiclayout.rst
@@ -4,7 +4,7 @@
Basic Layout
============
-The starter files generated by the ``alchemy`` scaffold are very basic, but
+The starter files generated by the ``alchemy`` cookiecutter are very basic, but
they provide a good orientation for the high-level patterns common to most
:term:`URL dispatch`-based :app:`Pyramid` projects.
@@ -29,7 +29,6 @@ code:
.. literalinclude:: src/basiclayout/tutorial/__init__.py
:end-before: main
- :linenos:
:lineno-match:
:language: py
@@ -38,7 +37,6 @@ the ``main`` function we've defined in our ``__init__.py``:
.. literalinclude:: src/basiclayout/tutorial/__init__.py
:pyobject: main
- :linenos:
:lineno-match:
:language: py
@@ -179,7 +177,7 @@ decorator in order to create a view configuration within our application.
Without being processed by ``scan``, the decorator effectively does nothing.
``@view_config`` is inert without being detected via a :term:`scan`.
-The sample ``my_view()`` created by the scaffold uses a ``try:`` and
+The sample ``my_view()`` created by the cookiecutter uses a ``try:`` and
``except:`` clause to detect if there is a problem accessing the project
database and provide an alternate error response. That response will include
the text shown at the end of the file, which will be displayed in the browser
@@ -191,7 +189,7 @@ Content models with the ``models`` package
In an SQLAlchemy-based application, a *model* object is an object composed by
querying the SQL database. The ``models`` package is where the ``alchemy``
-scaffold put the classes that implement our models.
+cookiecutter put the classes that implement our models.
First, open ``tutorial/models/meta.py``, which should already contain the
following:
@@ -222,7 +220,6 @@ application's database schema.
.. literalinclude:: src/basiclayout/tutorial/models/meta.py
:lines: 15-16
:lineno-match:
- :linenos:
:language: py
Next open ``tutorial/models/mymodel.py``, which should already contain the
@@ -239,7 +236,6 @@ we have defined one named ``MyModel`` in ``mymodel.py``:
.. literalinclude:: src/basiclayout/tutorial/models/mymodel.py
:pyobject: MyModel
:lineno-match:
- :linenos:
:language: py
Our example model does not require an ``__init__`` method because SQLAlchemy
@@ -292,7 +288,6 @@ database engine using :func:`sqlalchemy.engine_from_config` from the
.. literalinclude:: src/basiclayout/tutorial/models/__init__.py
:pyobject: get_engine
:lineno-match:
- :linenos:
:language: py
The function ``get_session_factory`` accepts an :term:`SQLAlchemy` database
@@ -303,7 +298,6 @@ used for creating sessions bound to the database engine.
.. literalinclude:: src/basiclayout/tutorial/models/__init__.py
:pyobject: get_session_factory
:lineno-match:
- :linenos:
:language: py
The function ``get_tm_session`` registers a database session with a transaction
@@ -314,7 +308,6 @@ unless an exception is raised, in which case the transaction will be aborted.
.. literalinclude:: src/basiclayout/tutorial/models/__init__.py
:pyobject: get_tm_session
:lineno-match:
- :linenos:
:language: py
Finally, we define an ``includeme`` function, which is a hook for use with
@@ -328,7 +321,6 @@ of an incoming request to our application.
.. literalinclude:: src/basiclayout/tutorial/models/__init__.py
:pyobject: includeme
:lineno-match:
- :linenos:
:language: py
That's about all there is to it regarding models, views, and initialization