From 9a8a2133e49b42594e27bd1b8a08e8bf88a117e6 Mon Sep 17 00:00:00 2001 From: Patricio Paez Date: Tue, 20 Nov 2012 18:48:45 -0600 Subject: More sync on ZODB wiki tutorial - literalinclude should refer to the file in the corresponding section - Remove extra lines --- docs/tutorials/wiki/basiclayout.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index f6050f391..033dcb28c 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -165,7 +165,7 @@ Configuration in ``development.ini`` 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 +.. literalinclude:: src/basiclayout/development.ini :language: ini Note the existence of an ``[app:main]`` section which specifies our WSGI -- cgit v1.2.3 From b0b299feddcb25f29e6eb133865956fcd5bc0d6b Mon Sep 17 00:00:00 2001 From: Patricio Paez Date: Sat, 1 Dec 2012 17:59:44 -0600 Subject: Update line references - In the Basic Layout and Authorization chapters of the ZODB wiki tutorial --- docs/tutorials/wiki/basiclayout.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index 033dcb28c..12cf86a91 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -31,13 +31,13 @@ point happens to be the ``main`` function within the file named #. *Lines 1-3*. Perform some dependency imports. -#. *Lines 5-7* Define a root factory for our Pyramid application. +#. *Lines 6-8* Define a root factory for our Pyramid application. -#. *Line 12*. We construct a :term:`Configurator` with a :term:`root +#. *Line 14*. We construct a :term:`Configurator` with a :term:`root factory` and the settings keywords parsed by :term:`PasteDeploy`. The root factory is named ``root_factory``. -#. *Line 13*. Register a 'static view' which answers requests which start +#. *Line 15*. Register a 'static view' which answers requests which start with with URL path ``/static`` using the :meth:`pyramid.config.Configurator.add_static_view method`. This statement registers a view that will serve up static assets, such as CSS @@ -50,7 +50,7 @@ point happens to be the ``main`` function within the file named package. The scaffold could have alternately used an *absolute* asset specification as the path (``tutorial:static``) but it does not. -#. *Line 14*. Perform a :term:`scan`. A scan will find :term:`configuration +#. *Line 16*. Perform a :term:`scan`. A scan will find :term:`configuration decoration`, such as view configuration decorators (e.g. ``@view_config``) in the source code of the ``tutorial`` package and will take actions based on these decorators. We don't pass any arguments to @@ -59,7 +59,7 @@ point happens to be the ``main`` function within the file named The scaffold could have equivalently said ``config.scan('tutorial')`` but it chose to omit the package name argument. -#. *Line 15*. Use the +#. *Line 17*. Use the :meth:`pyramid.config.Configurator.make_wsgi_app` method to return a :term:`WSGI` application. @@ -81,7 +81,7 @@ Here is the source for ``models.py``: :linenos: :language: py -#. *Lines 3-4*. The ``MyModel`` :term:`resource` class is implemented here. +#. *Lines 4-5*. The ``MyModel`` :term:`resource` class is implemented here. Instances of this class will be capable of being persisted in :term:`ZODB` because the class inherits from the :class:`persistent.mapping.PersistentMapping` class. The ``__parent__`` @@ -89,7 +89,7 @@ Here is the source for ``models.py``: By default, have these as ``None`` indicating that this is the :term:`root` object. -#. *Lines 6-12*. ``appmaker`` is used to return the *application +#. *Lines 8-14*. ``appmaker`` is used to return the *application root* object. It is called on *every request* to the :app:`Pyramid` application. It also performs bootstrapping by *creating* an application root (inside the ZODB root object) if one @@ -118,7 +118,7 @@ Let's try to understand the components in this module: #. *Lines 1-2*. Perform some dependency imports. -#. *Line 4*. Use the :func:`pyramid.view.view_config` :term:`configuration +#. *Line 5*. Use the :func:`pyramid.view.view_config` :term:`configuration decoration` to perform a :term:`view configuration` registration. This view configuration registration will be activated when the application is started. It will be activated by virtue of it being found as the result @@ -148,7 +148,7 @@ Let's try to understand the components in this module: ``my_view`` function which it decorates represents the "default" view callable used when the context is of the type ``MyModel``. -#. *Lines 5-6*. We define a :term:`view callable` named ``my_view``, which +#. *Lines 6-7*. We define a :term:`view callable` named ``my_view``, which we decorated in the step above. This view callable is a *function* we write generated by the ``zodb`` scaffold that is given a ``request`` and which returns a dictionary. The ``mytemplate.pt`` -- cgit v1.2.3 From 08c2217e7f831379016e1ddee0b5d51eeca53878 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 1 Jan 2013 23:56:02 +0200 Subject: eliminate repeated "the" words --- docs/tutorials/wiki/basiclayout.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index 12cf86a91..a7d8f1439 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -44,7 +44,7 @@ point happens to be the ``main`` function within the file named and image files, for us, in this case, at ``http://localhost:6543/static/`` and below. The first argument is the "name" ``static``, which indicates that the URL path prefix of the view - will be ``/static``. the The second argument of this tag is the "path", + will be ``/static``. The second argument of this tag is the "path", which is a relative :term:`asset specification`, so it finds the resources it should serve within the ``static`` directory inside the ``tutorial`` package. The scaffold could have alternately used an *absolute* asset -- cgit v1.2.3 From 043ccddb909327106264d10ed5d413760a51770d Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 2 Jan 2013 02:22:52 +0200 Subject: eliminate other repeated words --- docs/tutorials/wiki/basiclayout.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index a7d8f1439..da381ad7b 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -38,7 +38,7 @@ point happens to be the ``main`` function within the file named factory is named ``root_factory``. #. *Line 15*. Register a 'static view' which answers requests which start - with with URL path ``/static`` using the + with URL path ``/static`` using the :meth:`pyramid.config.Configurator.add_static_view method`. This statement registers a view that will serve up static assets, such as CSS and image files, for us, in this case, at -- cgit v1.2.3 From 445eb8708fa48209947377f6de609799dd843ad6 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 20 Jan 2013 17:10:40 +0200 Subject: point to the sources of the wiki tutorials in just one location; fix #763 * This avoids having to update the link multiple times. * Also, mention their location, in case user has Pyramid checkout. --- docs/tutorials/wiki/basiclayout.rst | 3 --- 1 file changed, 3 deletions(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index da381ad7b..aab22408b 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -6,9 +6,6 @@ The starter files generated by the ``zodb`` scaffold 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/1.3-branch/docs/tutorials/wiki/src/basiclayout/ -`_. Application Configuration with ``__init__.py`` ------------------------------------------------ -- cgit v1.2.3 From 14ffa6c187e30c2756adc548f90c8ab6de34534c Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 22 Jan 2013 08:07:31 +0200 Subject: typo --- docs/tutorials/wiki/basiclayout.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index aab22408b..756a4b3b5 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -165,7 +165,7 @@ opposed to the tutorial :term:`package` directory) looks like this: .. literalinclude:: src/basiclayout/development.ini :language: ini -Note the existence of an ``[app:main]`` section which specifies our WSGI +Note the existence of a ``[app:main]`` section which specifies our WSGI application. Our ZODB database settings are specified as the ``zodbconn.uri`` setting within this section. This value, and the other values within this section are passed as ``**settings`` to the ``main`` -- cgit v1.2.3 From 49d8235ccca2055ca368f751037136175f80d015 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 22 Jan 2013 00:06:20 -0800 Subject: More grammar clean up. --- docs/tutorials/wiki/basiclayout.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'docs/tutorials/wiki/basiclayout.rst') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index aab22408b..03abedbd8 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -4,7 +4,7 @@ Basic Layout The starter files generated by the ``zodb`` scaffold 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. +:term:`traversal` -based :app:`Pyramid` (and :term:`ZODB` -based) projects. Application Configuration with ``__init__.py`` @@ -12,8 +12,8 @@ Application Configuration with ``__init__.py`` A directory on disk can be turned into a Python :term:`package` by containing an ``__init__.py`` file. Even if empty, this marks a directory as a Python -package. Our application uses ``__init__.py`` as both a package marker, as -well as to contain application configuration code. +package. Our application uses ``__init__.py`` both as a package marker and +to contain application configuration code. When you run the application using the ``pserve`` command using the ``development.ini`` generated config file, the application configuration @@ -28,14 +28,14 @@ point happens to be the ``main`` function within the file named #. *Lines 1-3*. Perform some dependency imports. -#. *Lines 6-8* Define a root factory for our Pyramid application. +#. *Lines 6-8*. Define a root factory for our Pyramid application. #. *Line 14*. We construct a :term:`Configurator` with a :term:`root factory` and the settings keywords parsed by :term:`PasteDeploy`. The root factory is named ``root_factory``. -#. *Line 15*. Register a 'static view' which answers requests which start - with URL path ``/static`` using the +#. *Line 15*. Register a "static view" which answers requests whose URL path + start with ``/static`` using the :meth:`pyramid.config.Configurator.add_static_view method`. This statement registers a view that will serve up static assets, such as CSS and image files, for us, in this case, at @@ -44,16 +44,16 @@ point happens to be the ``main`` function within the file named will be ``/static``. The second argument of this tag is the "path", which is a relative :term:`asset specification`, so it finds the resources it should serve within the ``static`` directory inside the ``tutorial`` - package. The scaffold could have alternately used an *absolute* asset - specification as the path (``tutorial:static``) but it does not. + package. Alternatively the scaffold could have used an *absolute* asset + specification as the path (``tutorial:static``). #. *Line 16*. Perform a :term:`scan`. A scan will find :term:`configuration - decoration`, such as view configuration decorators (e.g. ``@view_config``) + decoration`, such as view configuration decorators (e.g., ``@view_config``) in the source code of the ``tutorial`` package and will take actions based on these decorators. We don't pass any arguments to :meth:`~pyramid.config.Configurator.scan`, which implies that the scan should take place in the current package (in this case, ``tutorial``). - The scaffold could have equivalently said ``config.scan('tutorial')`` but + The scaffold could have equivalently said ``config.scan('tutorial')``, but it chose to omit the package name argument. #. *Line 17*. Use the @@ -70,7 +70,7 @@ tree represents the site structure, but it *also* represents the :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 ``zodb`` scaffold put the classes that implement our -resource objects, each of which happens also to be a domain model object. +resource objects, each of which also happens to be a domain model object. Here is the source for ``models.py``: @@ -79,7 +79,7 @@ Here is the source for ``models.py``: :language: py #. *Lines 4-5*. The ``MyModel`` :term:`resource` class is implemented here. - Instances of this class will be capable of being persisted in :term:`ZODB` + Instances of this class are capable of being persisted in :term:`ZODB` because the class inherits from the :class:`persistent.mapping.PersistentMapping` class. The ``__parent__`` and ``__name__`` are important parts of the :term:`traversal` protocol. @@ -137,7 +137,7 @@ Let's try to understand the components in this module: indeed if you look in the ``templates`` directory of this package, you'll see a ``mytemplate.pt`` template file, which renders the default home page of the generated project. This asset specification is *relative* (to the - view.py's current package). We could have alternately an used the + view.py's current package). Alternatively we could have used the absolute asset specification ``tutorial:templates/mytemplate.pt``, but chose to use the relative version. -- cgit v1.2.3