diff options
| author | Casey Duncan <casey.duncan@gmail.com> | 2011-01-01 13:23:15 -0700 |
|---|---|---|
| committer | Casey Duncan <casey.duncan@gmail.com> | 2011-01-01 13:23:15 -0700 |
| commit | ad838b5d01980b156f763bea4cd655bf50a61783 (patch) | |
| tree | d9a5bef6ae4d1bb484a165539edfb40062e54377 /docs | |
| parent | f4b5b973c23ac629c7dd6a093a69ebdbc206b42a (diff) | |
| download | pyramid-ad838b5d01980b156f763bea4cd655bf50a61783.tar.gz pyramid-ad838b5d01980b156f763bea4cd655bf50a61783.tar.bz2 pyramid-ad838b5d01980b156f763bea4cd655bf50a61783.zip | |
rework opening explanation of the resource tree for clarity
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/traversal.rst | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/docs/narr/traversal.rst b/docs/narr/traversal.rst index d5f61fa1b..c6da5e5ef 100644 --- a/docs/narr/traversal.rst +++ b/docs/narr/traversal.rst @@ -96,18 +96,20 @@ chapter. The Resource Tree ----------------- -When your application uses :term:`traversal` to resolve URLs to code, the -application must supply a :term:`resource tree` to :app:`Pyramid`. The -resource tree is a set of nested dictionary-like objects. The root of the -tree is represented by a :term:`root` resource. - -In order to supply a root resource for an application, at system startup -time, the :app:`Pyramid` :term:`Router` is configured with a callback known -as a :term:`root factory`. The root factory is supplied by the application -developer as the ``root_factory`` argument to the application's -:term:`Configurator`. - -Here's an example of a simple root factory: +The resource tree is a set of nested dictionary-like resource objects +that begins with a :term:`root` resource. In order to use +:term:`traversal` to resolve URLs to code, your application must supply +a :term:`resource tree` to :app:`Pyramid`. + +In order to supply a root resource for an application the :app:`Pyramid` +:term:`Router` is configured with a callback known as a :term:`root +factory`. The root factory is supplied by the application, at startup +time, as the ``root_factory`` argument to the :term:`Configurator`. + +The root factory is a Python callable that accepts a :term:`request` +object, and returns the root object of the :term:`resource tree`. A +function, or class is typically used as an application's root factory. +Here's an example of a simple root factory class: .. code-block:: python :linenos: |
