diff options
Diffstat (limited to 'docs/designdefense.rst')
| -rw-r--r-- | docs/designdefense.rst | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/designdefense.rst b/docs/designdefense.rst index 147a52c31..9a1eb6b8a 100644 --- a/docs/designdefense.rst +++ b/docs/designdefense.rst @@ -536,15 +536,15 @@ traversal as well. You can actually *combine* URL dispatch and traversal in :app:`Pyramid` (see :ref:`hybrid_chapter`). One example of such a usage: if you want to emulate something like Zope 2's "Zope Management Interface" UI on top of your object graph (or any administrative interface), you can register -a route like ``<route name="manage" pattern="manage/*traverse"/>`` and then +a route like ``config.add_route('manage', '/manage/*traverse')`` and then associate "management" views in your code by using the ``route_name`` -argument to a ``view`` configuration, e.g. ``<view view=".some.callable" -context=".some.Resource" route_name="manage"/>``. If you wire things up this -way someone then walks up to for example, ``/manage/ob1/ob2``, they might be -presented with a management interface, but walking up to ``/ob1/ob2`` would -present them with the default object view. There are other tricks you can -pull in these hybrid configurations if you're clever (and maybe masochistic) -too. +argument to a ``view`` configuration, +e.g. ``config.add_view('.some.callable', context=".some.Resource", +route_name='manage')``. If you wire things up this way someone then walks up +to for example, ``/manage/ob1/ob2``, they might be presented with a +management interface, but walking up to ``/ob1/ob2`` would present them with +the default object view. There are other tricks you can pull in these hybrid +configurations if you're clever (and maybe masochistic) too. Also, if you are a URL dispatch hater, if you should ever be asked to write an application that must use some legacy relational database structure, you |
