diff options
| author | Michael Merickel <michael@digitalartefacts.com> | 2013-10-19 02:04:02 -0500 |
|---|---|---|
| committer | Michael Merickel <michael@digitalartefacts.com> | 2013-10-19 02:04:02 -0500 |
| commit | c137eccf36aed3200592da0b170bc7f3ba1313b6 (patch) | |
| tree | 3599f91b8c4863613be977ce847e5739b1f34804 /docs/narr/traversal.rst | |
| parent | 8385569b371a2586acf1680937ca656136c2502c (diff) | |
| parent | 3acee31f86bcde8abbb4e63715afc5ca67976eaf (diff) | |
| download | pyramid-c137eccf36aed3200592da0b170bc7f3ba1313b6.tar.gz pyramid-c137eccf36aed3200592da0b170bc7f3ba1313b6.tar.bz2 pyramid-c137eccf36aed3200592da0b170bc7f3ba1313b6.zip | |
Merge branch 'master' into feature.signed-cookie-session
Diffstat (limited to 'docs/narr/traversal.rst')
| -rw-r--r-- | docs/narr/traversal.rst | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/docs/narr/traversal.rst b/docs/narr/traversal.rst index a60c5ba56..454bb5620 100644 --- a/docs/narr/traversal.rst +++ b/docs/narr/traversal.rst @@ -146,35 +146,15 @@ refer to a root factory defined in a different module. If no :term:`root factory` is passed to the :app:`Pyramid` :term:`Configurator` constructor, or if the ``root_factory`` value -specified is ``None``, a *default* root factory is used. The default +specified is ``None``, a :term:`default root factory` is used. The default root factory always returns a resource that has no child resources; it is effectively empty. Usually a root factory for a traversal-based application will be more -complicated than the above ``Root`` class; in particular it may be -associated with a database connection or another persistence mechanism. - -.. sidebar:: Emulating the Default Root Factory - - For purposes of understanding the default root factory better, we'll note - that you can emulate the default root factory by using this code as an - explicit root factory in your application setup: - - .. code-block:: python - :linenos: - - class Root(object): - def __init__(self, request): - pass - - config = Configurator(root_factory=Root) - - The default root factory is just a really stupid object that has no - behavior or state. Using :term:`traversal` against an application that - uses the resource tree supplied by the default root resource is not very - interesting, because the default root resource has no children. Its - availability is more useful when you're developing an application using - :term:`URL dispatch`. +complicated than the above ``Root`` class; in particular it may be associated +with a database connection or another persistence mechanism. The above +``Root`` class is analogous to the default root factory present in Pyramid. The +default root factory is very simple and not very useful. .. note:: |
