diff options
| author | Chris McDonough <chrism@agendaless.com> | 2010-01-03 03:39:30 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2010-01-03 03:39:30 +0000 |
| commit | eecdbc34962b00e35d41039af014462cf558acee (patch) | |
| tree | 784bfdf054d6f4846fb1817d1ba7b01792792dcc /docs/zcml.rst | |
| parent | 1dff935445ff293a7434f074c1f6bb7304174ec2 (diff) | |
| download | pyramid-eecdbc34962b00e35d41039af014462cf558acee.tar.gz pyramid-eecdbc34962b00e35d41039af014462cf558acee.tar.bz2 pyramid-eecdbc34962b00e35d41039af014462cf558acee.zip | |
Features
--------
- The ``Configurator.add_view`` method now accepts an argument named
``context``. This is an alias for the older argument named
``for_``; it is preferred over ``for_``, but ``for_`` will continue
to be supported "forever".
- The ``view`` ZCML directive now accepts an attribute named
``context``. This is an alias for the older attribute named
``for``; it is preferred over ``for``, but ``for`` will continue to
be supported "forever".
- The ``Configurator.add_route`` method now accepts an argument named
``view_context``. This is an alias for the older argument named
``view_for``; it is preferred over ``view_for``, but ``view_for``
will continue to be supported "forever".
- The ``route`` ZCML directive now accepts an attribute named
``view_context``. This is an alias for the older attribute named
``view_for``; it is preferred over ``view_for``, but ``view_for``
will continue to be supported "forever".
Documentation and Paster Templates
----------------------------------
- All uses of the ``Configurator.add_view`` method that used its
``for_`` argument now use the ``context``argument instead.
- All uses of the ``Configurator.add_route`` method that used its
``view_for`` argument now use the ``view_context``argument instead.
- All uses of the ``view`` ZCML directive that used its ``for``
attribute now use the ``context`` attribute instead.
- All uses of the ``route`` ZCML directive that used its ``view_for``
attribute now use the ``view_context`` attribute instead.
Diffstat (limited to 'docs/zcml.rst')
| -rw-r--r-- | docs/zcml.rst | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/docs/zcml.rst b/docs/zcml.rst index a24715090..528b9098a 100644 --- a/docs/zcml.rst +++ b/docs/zcml.rst @@ -297,14 +297,16 @@ Predicate Attributes The *view name*. Read the :ref:`traversal_chapter` to understand the concept of a view name. -``for`` +``context`` A :term:`dotted Python name` representing the Python class that the :term:`context` must be an instance of, *or* the :term:`interface` that the :term:`context` must provide in order for this view to be found and called. This predicate is true when the :term:`context` is an instance of the represented class or if the :term:`context` - provides the represented interface; it is otherwise false. + provides the represented interface; it is otherwise false. An + alternate name for this attribute is ``for`` (this is an older + spelling). ``route_name`` @@ -443,7 +445,7 @@ Examples :linenos: <view - for=".models.MyModel" + context=".models.MyModel" view=".views.hello_world" /> @@ -453,7 +455,7 @@ Examples :linenos: <view - for=".models.MyModel" + context=".models.MyModel" view=".views.hello_world_post" request_method="POST" /> @@ -602,7 +604,7 @@ Attributes .. note:: This feature is new as of :mod:`repoze.bfg` 1.2. -``view_for`` +``view_context`` The :term:`dotted Python name` to a class or an interface that the :term:`context` of the view should match for the view named by the @@ -613,7 +615,8 @@ Attributes If the ``view`` attribute is not provided, this attribute has no effect. - This attribute can also be spelled as ``for``. + This attribute can also be spelled as ``view_for`` or ``for_``; + these are valid older spellings. ``view_permission`` |
