summaryrefslogtreecommitdiff
path: root/CHANGES.txt
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-07-23 07:15:05 +0000
committerChris McDonough <chrism@agendaless.com>2010-07-23 07:15:05 +0000
commitef8a8c8c04a53d3913141e1bf85c11728721e2a3 (patch)
treea369ea8fc50dacc581fabe7119f7f84616692958 /CHANGES.txt
parentb4c212546023e41243ea30886f9afb8625e89c93 (diff)
downloadpyramid-ef8a8c8c04a53d3913141e1bf85c11728721e2a3.tar.gz
pyramid-ef8a8c8c04a53d3913141e1bf85c11728721e2a3.tar.bz2
pyramid-ef8a8c8c04a53d3913141e1bf85c11728721e2a3.zip
- New argument to ``repoze.bfg.configuration.Configurator.add_route``
and the ``route`` ZCML directive: ``traverse``. If you would like to cause the ``context`` to be something other than the ``root`` object when this route matches, you can spell a traversal pattern as the ``traverse`` argument. This traversal pattern will be used as the traversal path: traversal will begin at the root object implied by this route (either the global root, or the object returned by the ``factory`` associated with this route). The syntax of the ``traverse`` argument is the same as it is for ``path``. For example, if the ``path`` provided is ``articles/:article/edit``, and the ``traverse`` argument provided is ``/:article``, when a request comes in that causes the route to match in such a way that the ``article`` match value is '1' (when the request URI is ``/articles/1/edit``), the traversal path will be generated as ``/1``. This means that the root object's ``__getitem__`` will be called with the name ``1`` during the traversal phase. If the ``1`` object exists, it will become the ``context`` of the request. The Traversal narrative has more information about traversal. If the traversal path contains segment marker names which are not present in the path argument, a runtime error will occur. The ``traverse`` pattern should not contain segment markers that do not exist in the ``path``. A similar combining of routing and traversal is available when a route is matched which contains a ``*traverse`` remainder marker in its path. The ``traverse`` argument allows you to associate route patterns with an arbitrary traversal path without using a a ``*traverse`` remainder marker; instead you can use other match information. Note that the ``traverse`` argument is ignored when attached to a route that has a ``*traverse`` remainder marker in its path.
Diffstat (limited to 'CHANGES.txt')
-rw-r--r--CHANGES.txt37
1 files changed, 37 insertions, 0 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 9fadd1beb..dfdec3ec6 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -13,6 +13,43 @@ Features
``bfg_view`` API, the Configurator ``add_view`` API, and the ZCML
``view`` directive.
+- New argument to ``repoze.bfg.configuration.Configurator.add_route``
+ and the ``route`` ZCML directive: ``traverse``. If you would like
+ to cause the ``context`` to be something other than the ``root``
+ object when this route matches, you can spell a traversal pattern as
+ the ``traverse`` argument. This traversal pattern will be used as
+ the traversal path: traversal will begin at the root object implied
+ by this route (either the global root, or the object returned by the
+ ``factory`` associated with this route).
+
+ The syntax of the ``traverse`` argument is the same as it is for
+ ``path``. For example, if the ``path`` provided is
+ ``articles/:article/edit``, and the ``traverse`` argument provided
+ is ``/:article``, when a request comes in that causes the route to
+ match in such a way that the ``article`` match value is '1' (when
+ the request URI is ``/articles/1/edit``), the traversal path will be
+ generated as ``/1``. This means that the root object's
+ ``__getitem__`` will be called with the name ``1`` during the
+ traversal phase. If the ``1`` object exists, it will become the
+ ``context`` of the request. The Traversal narrative has more
+ information about traversal.
+
+ If the traversal path contains segment marker names which are not
+ present in the path argument, a runtime error will occur. The
+ ``traverse`` pattern should not contain segment markers that do not
+ exist in the ``path``.
+
+ A similar combining of routing and traversal is available when a
+ route is matched which contains a ``*traverse`` remainder marker in
+ its path. The ``traverse`` argument allows you to associate route
+ patterns with an arbitrary traversal path without using a a
+ ``*traverse`` remainder marker; instead you can use other match
+ information.
+
+ Note that the ``traverse`` argument is ignored when attached to a
+ route that has a ``*traverse`` remainder marker in its path.
+
+
Documentation
-------------