| | |
| | | :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 |