diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-01-18 18:07:12 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-01-18 18:07:12 +0000 |
| commit | c5f24b2957a2a7569d70930ac5bc630cc5aaac55 (patch) | |
| tree | b6c09425e10c2900bf2120dfe4d390e9070f960c /docs/tutorials | |
| parent | e4ed8fdb6acc8a9b040c8f61221da0e79821e071 (diff) | |
| download | pyramid-c5f24b2957a2a7569d70930ac5bc630cc5aaac55.tar.gz pyramid-c5f24b2957a2a7569d70930ac5bc630cc5aaac55.tar.bz2 pyramid-c5f24b2957a2a7569d70930ac5bc630cc5aaac55.zip | |
Prep for b1
Merge a bunch of paper-based docs fixes
Configure logging during bfgshell.
Diffstat (limited to 'docs/tutorials')
| -rw-r--r-- | docs/tutorials/bfgwiki/authorization.rst | 4 | ||||
| -rw-r--r-- | docs/tutorials/bfgwiki/basiclayout.rst | 14 | ||||
| -rw-r--r-- | docs/tutorials/bfgwiki/installation.rst | 2 | ||||
| -rw-r--r-- | docs/tutorials/bfgwiki2/authorization.rst | 14 | ||||
| -rw-r--r-- | docs/tutorials/bfgwiki2/basiclayout.rst | 12 | ||||
| -rw-r--r-- | docs/tutorials/bfgwiki2/definingmodels.rst | 9 | ||||
| -rw-r--r-- | docs/tutorials/bfgwiki2/installation.rst | 2 |
7 files changed, 31 insertions, 26 deletions
diff --git a/docs/tutorials/bfgwiki/authorization.rst b/docs/tutorials/bfgwiki/authorization.rst index b2c5330f6..1b83d3651 100644 --- a/docs/tutorials/bfgwiki/authorization.rst +++ b/docs/tutorials/bfgwiki/authorization.rst @@ -50,8 +50,8 @@ content: :language: python The ``groupfinder`` function defined here is an authorization policy -"callback"; it is a a callable that accepts a userid and a request. -If the userid exists in the set of users known by the system, the +"callback"; it is a callable that accepts a userid and a request. If +the userid exists in the set of users known by the system, the callback will return a sequence of group identifiers (or an empty sequence if the user isn't a member of any groups). If the userid *does not* exist in the system, the callback will return ``None``. diff --git a/docs/tutorials/bfgwiki/basiclayout.rst b/docs/tutorials/bfgwiki/basiclayout.rst index 213f238fd..c2b2ebd4b 100644 --- a/docs/tutorials/bfgwiki/basiclayout.rst +++ b/docs/tutorials/bfgwiki/basiclayout.rst @@ -106,32 +106,32 @@ function within the file named ``run.py``: :linenos: :language: py -#. *Lines 1-3*. Perform some dependency imports. +#. *Lines 1-2*. Perform some dependency imports. -#. *Line 11*. Get the ZODB configuration from the ``tutorial.ini`` +#. *Line 12*. Get the ZODB configuration from the ``tutorial.ini`` file's ``[app:main]`` section represented by the ``settings`` dictionary passed to our ``app`` function. This will be a URI (something like ``file:///path/to/Data.fs``). -#. *Line 14*. We create a "finder" object using the +#. *Line 15*. We create a "finder" object using the ``PersistentApplicationFinder`` helper class, passing it the ZODB URI and the "appmaker" we've imported from ``models.py``. -#. *Lines 15 - 16*. We create a :term:`root factory` which uses the +#. *Lines 16 - 17*. We create a :term:`root factory` which uses the finder to return a ZODB root object. -#. *Line 17*. We construct a :term:`Configurator` with a :term:`root +#. *Line 18*. We construct a :term:`Configurator` with a :term:`root factory` and the settings keywords parsed by PasteDeploy. The root factory is named ``get_root``. -#. *Lines 18-20*. Begin configuration using the ``begin`` method of +#. *Lines 19-21*. Begin configuration using the ``begin`` method of the :meth:`repoze.bfg.configuration.Configurator` class, load the ``configure.zcml`` file from our package using the :meth:`repoze.bfg.configuration.Configurator.load_zcml` method, and end configuration using the :meth:`repoze.bfg.configuration.Configurator.end` method. -#. *Line 21*. Use the +#. *Line 22*. Use the :meth:`repoze.bfg.configuration.Configurator.make_wsgi_app` method to return a :term:`WSGI` application. diff --git a/docs/tutorials/bfgwiki/installation.rst b/docs/tutorials/bfgwiki/installation.rst index fcfaff642..4f1e5a34f 100644 --- a/docs/tutorials/bfgwiki/installation.rst +++ b/docs/tutorials/bfgwiki/installation.rst @@ -112,7 +112,7 @@ Preparation, Windows .. code-block:: bat - c:\bigfntut> Scripts/easy_install -i \ + c:\bigfntut> Scripts\easy_install -i \ http://dist.repoze.org/bfg/current/simple repoze.bfg #. Use ``easy_install`` to install ``docutils``, ``repoze.tm``, diff --git a/docs/tutorials/bfgwiki2/authorization.rst b/docs/tutorials/bfgwiki2/authorization.rst index 7383fe327..9a37760f1 100644 --- a/docs/tutorials/bfgwiki2/authorization.rst +++ b/docs/tutorials/bfgwiki2/authorization.rst @@ -105,13 +105,13 @@ Adding ``security.py`` Add a ``security.py`` module within your package (in the same directory as "run.py", "views.py", etc) with the following content: The groupfinder defined here is an :term:`authentication policy` -"callback"; it is a a callable that accepts a userid and a request. -If the userid exists in the system, the callback will return a -sequence of group identifiers (or an empty sequence if the user isn't -a member of any groups). If the userid *does not* exist in the -system, the callback will return ``None``. We'll use "dummy" data to -represent user and groups sources. When we're done, your -application's ``security.py`` will look like this. +"callback"; it is a callable that accepts a userid and a request. If +the userid exists in the system, the callback will return a sequence +of group identifiers (or an empty sequence if the user isn't a member +of any groups). If the userid *does not* exist in the system, the +callback will return ``None``. We'll use "dummy" data to represent +user and groups sources. When we're done, your application's +``security.py`` will look like this. .. literalinclude:: src/authorization/tutorial/security.py :linenos: diff --git a/docs/tutorials/bfgwiki2/basiclayout.rst b/docs/tutorials/bfgwiki2/basiclayout.rst index 70e7a8a62..4c2d5d238 100644 --- a/docs/tutorials/bfgwiki2/basiclayout.rst +++ b/docs/tutorials/bfgwiki2/basiclayout.rst @@ -82,25 +82,25 @@ Here is the source for ``models.py``: manager* instead of controlling commits and aborts to database operations by hand. -#. *Line 20*. Set up a SQLAlchemy metadata object. +#. *Line 21*. Set up a SQLAlchemy metadata object. -#. *Lines 22-24*. A model class named ``Model``. It has an +#. *Lines 23-25*. A model class named ``Model``. It has an ``__init__`` that takes a single argument (``name``). It stores a single attribute named ``name``. -#. *Lines 26-31*. A SQLAlchemy ``Table`` declaration named +#. *Lines 27-32*. A SQLAlchemy ``Table`` declaration named ``models_table`` which we'll use later to map onto our ``Model`` class. -#. *Line 33*. We map our ``models_table`` table to our Models class +#. *Line 34*. We map our ``models_table`` table to our Models class here. This makes an association between the ``Model`` class and the ``models`` table in the database, as far as SQLAlchemy is concerned. -#. *Lines 35-40*. A function named ``populate`` which adds a single +#. *Lines 36-41*. A function named ``populate`` which adds a single model instance into our SQL storage and commits a transaction. -#. *Lines 42-50*. A function named ``initialize_sql`` which sets up +#. *Lines 43-51*. A function named ``initialize_sql`` which sets up an actual SQL database and binds it to our SQLAlchemy DBSession object. It also calls the ``populate`` function, to do initial database population. diff --git a/docs/tutorials/bfgwiki2/definingmodels.rst b/docs/tutorials/bfgwiki2/definingmodels.rst index 214a5e908..d2db4955e 100644 --- a/docs/tutorials/bfgwiki2/definingmodels.rst +++ b/docs/tutorials/bfgwiki2/definingmodels.rst @@ -68,6 +68,11 @@ Viewing the Application in a Browser ------------------------------------ We can't. At this point, our system is in a "non-runnable" state; -we'll need to change the "views" (and associated files) in the next -chapter to be able to start and run the application successfully. +we'll need to change view-related files in the next chapter to be able +to start the application successfully. If you try to start the +application, you'll wind up with a Python traceback on your console +that ends with this exception: +.. code-block:: text + + ImportError: cannot import name Model diff --git a/docs/tutorials/bfgwiki2/installation.rst b/docs/tutorials/bfgwiki2/installation.rst index 1a37e1c4d..4c8dc7080 100644 --- a/docs/tutorials/bfgwiki2/installation.rst +++ b/docs/tutorials/bfgwiki2/installation.rst @@ -113,7 +113,7 @@ Preparation, Windows .. code-block:: text - c:\bigfntut> Scripts/easy_install -i \ + c:\bigfntut> Scripts\easy_install -i \ http://dist.repoze.org/bfg/current/simple repoze.bfg #. Use ``easy_install`` to install various packages from PyPI. |
