From b743bb4da42198f223ec756936dc0c581b08b534 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 23 Dec 2010 20:01:42 -0500 Subject: tutorial accuracy and wording improvements --- docs/tutorials/wiki/basiclayout.rst | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index 8e6e89e57..f6e1f800a 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -2,10 +2,9 @@ Basic Layout ============ -The starter files generated by the ``pyramid_zodb`` template are basic, -but they provide a good orientation for the high-level patterns common -to most :term:`traversal` -based :app:`Pyramid` (and :term:`ZODB` -based) projects. +The starter files generated by the ``pyramid_zodb`` template are basic, but +they provide a good orientation for the high-level patterns common to most +:term:`traversal` -based :app:`Pyramid` (and :term:`ZODB` based) projects. The source code for this tutorial stage can be browsed via `http://github.com/Pylons/pyramid/tree/master/docs/tutorials/wiki/src/basiclayout/ @@ -78,11 +77,10 @@ Resources and Models with ``models.py`` hierarchically in a :term:`resource tree`. This tree is consulted by :term:`traversal` to map URLs to code. In this application, the resource tree represents the site structure, but it *also* represents the -:term:`domain model` of the application, because eeach resource is a node +:term:`domain model` of the application, because each resource is a node stored persistently in a :term:`ZODB` database. The ``models.py`` file is where the ``pyramid_zodb`` Paster template put the classes that implement our -resource objects, each of which happens also to be a domain model -object. +resource objects, each of which happens also to be a domain model object. Here is the source for ``models.py``: -- cgit v1.2.3 From be3d6f9b1bc55a5c20b04d36a0724f1ec092d169 Mon Sep 17 00:00:00 2001 From: Blaise Laflamme Date: Thu, 6 Jan 2011 00:35:40 -0500 Subject: Updated wiki tutorial docs --- docs/tutorials/wiki/basiclayout.rst | 1 - 1 file changed, 1 deletion(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index f6e1f800a..4017d7af8 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -169,7 +169,6 @@ The ``development.ini`` (in the tutorial :term:`project` directory, as opposed to the tutorial :term:`package` directory) looks like this: .. literalinclude:: src/views/development.ini - :linenos: :language: ini -- cgit v1.2.3 From 607d756e962dce912134e075dbcc5f11a91987f0 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 19 Jan 2011 21:34:19 -0500 Subject: - The ``pyramid_zodb``, ``pyramid_routesalchemy`` and ``pyramid_alchemy`` paster templates now use a default "commit veto" hook when configuring the ``repoze.tm2`` transaction manager in ``development.ini``. This prevents a transaction from being committed when the response status code is within the 400 or 500 ranges. See also http://docs.repoze.org/tm2/#using-a-commit-veto. --- docs/tutorials/wiki/basiclayout.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index 4017d7af8..884f17840 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -187,9 +187,11 @@ The ``egg:repoze.zodbconn#closer`` middleware is in the middle of the pipeline. This is a piece of middleware which closes the ZODB connection opened by the ``PersistentApplicationFinder`` at the end of the request. -The ``egg:repoze.tm#tm`` middleware is the last piece of middleware in the -pipeline. This commits a transaction near the end of the request unless -there's an exception raised. +The ``tm`` middleware is the last piece of middleware in the pipeline. This +commits a transaction near the end of the request unless there's an exception +raised or the HTTP response code is an error code. The ``tm`` refers to the +``[filter:tm]`` section beneath the pipeline declaration, which configures +the transaction manager. The final line in the ``[pipeline:main]`` section is ``tutorial``, which refers to the ``[app:tutorial]`` section above it. The ``[app:tutorial]`` -- cgit v1.2.3 From 9afa52f0783d77b19e6ff0a509c5d556950a8a46 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 29 Jan 2011 02:34:40 -0500 Subject: - Added ``egg:repoze.retry#retry`` middleware to the WSGI pipeline in ZODB templates (retry ZODB conflict errors which occur in normal operations). --- docs/tutorials/wiki/basiclayout.rst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index 884f17840..7fe7daac8 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -187,6 +187,11 @@ The ``egg:repoze.zodbconn#closer`` middleware is in the middle of the pipeline. This is a piece of middleware which closes the ZODB connection opened by the ``PersistentApplicationFinder`` at the end of the request. +The ``egg:repoze.retry#retry`` middleware catches ``ConflictError`` +exceptions from ZODB and retries the request up to three times (ZODB is an +optimistic concurrency database that relies on application-level transaction +retries when a conflict occurs). + The ``tm`` middleware is the last piece of middleware in the pipeline. This commits a transaction near the end of the request unless there's an exception raised or the HTTP response code is an error code. The ``tm`` refers to the -- cgit v1.2.3 From 291995fa17ae55adfda09c4eda095fd5e8cb21d8 Mon Sep 17 00:00:00 2001 From: Chris Beelby Date: Thu, 3 Feb 2011 14:00:48 -0500 Subject: Corrected a/an usage and also clarified "deployment" to mean to a production system (as opposed to deploying to a development, QA, etc... machine) --- docs/tutorials/wiki/basiclayout.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index 884f17840..5c1dcb0e6 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -20,7 +20,7 @@ well as to contain application configuration code. When you run the application using the ``paster`` command using the ``development.ini`` generated config file, the application configuration -points at an Setuptools *entry point* described as ``egg:tutorial``. In our +points at a Setuptools *entry point* described as ``egg:tutorial``. In our application, because the application's ``setup.py`` file says so, this entry point happens to be the ``main`` function within the file named ``__init__.py``: @@ -181,7 +181,7 @@ composed of :term:`middleware`. The ``egg:WebError#evalerror`` middleware is at the "top" of the pipeline. This is middleware which displays debuggable errors in the browser while -you're developing (not recommended for deployment). +you're developing (not recommended for a production system). The ``egg:repoze.zodbconn#closer`` middleware is in the middle of the pipeline. This is a piece of middleware which closes the ZODB connection -- cgit v1.2.3