diff options
| author | Bert JW Regeer <bertjw@regeer.org> | 2013-09-03 18:30:56 -0600 |
|---|---|---|
| committer | Bert JW Regeer <bertjw@regeer.org> | 2013-09-03 18:30:56 -0600 |
| commit | 44436e1240f497e598de7b316ffaf7b6b8665452 (patch) | |
| tree | ed3e5de22f1b6b95b7d6514dd369782ef04e8aa8 /docs/narr/traversal.rst | |
| parent | c41c76bf713b636a19e97b319294ecf98885d1b5 (diff) | |
| download | pyramid-44436e1240f497e598de7b316ffaf7b6b8665452.tar.gz pyramid-44436e1240f497e598de7b316ffaf7b6b8665452.tar.bz2 pyramid-44436e1240f497e598de7b316ffaf7b6b8665452.zip | |
Removed unnecessary side bar with duplicate content
The side-bar contained a duplication of code that was already in the
main article. Adding a note instead and removing the side-bar provides
the same information without nearly as much duplication.
Diffstat (limited to 'docs/narr/traversal.rst')
| -rw-r--r-- | docs/narr/traversal.rst | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/docs/narr/traversal.rst b/docs/narr/traversal.rst index a60c5ba56..fb4adff61 100644 --- a/docs/narr/traversal.rst +++ b/docs/narr/traversal.rst @@ -128,6 +128,12 @@ Here's an example of a simple root factory class: def __init__(self, request): pass +..note:: + For the purpose of understanding traversal, and the contents within + this document, the above Root is an analogue to the default root + factory present in Pyramid. The default root factory is very simple and + not very useful unless using :term:`URL dispatch`. + Here's an example of using this root factory within startup configuration, by passing it to an instance of a :term:`Configurator` named ``config``: @@ -154,28 +160,6 @@ 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`. - .. note:: If the items contained within the resource tree are "persistent" (they |
