diff options
| author | Chris McDonough <chrism@plope.com> | 2011-08-29 13:11:45 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-08-29 13:11:45 -0400 |
| commit | c0e6e69eb75ae042f0db3b98a5e064a94235837a (patch) | |
| tree | 493c00067b0c829edfe5250a3f65fc52eba79e59 /docs | |
| parent | ec98cbf480a7a931c22f1f622536334494740698 (diff) | |
| download | pyramid-c0e6e69eb75ae042f0db3b98a5e064a94235837a.tar.gz pyramid-c0e6e69eb75ae042f0db3b98a5e064a94235837a.tar.bz2 pyramid-c0e6e69eb75ae042f0db3b98a5e064a94235837a.zip | |
add match_param to the narrative docs
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/viewconfig.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst index a1b12ad2a..26cca2ad1 100644 --- a/docs/narr/viewconfig.rst +++ b/docs/narr/viewconfig.rst @@ -304,6 +304,25 @@ configured view. If ``request_param`` is not supplied, the view will be invoked without consideration of keys and values in the ``request.params`` dictionary. +``match_param`` + .. note:: This feature is new as of :app:`Pyramid` 1.2. + + This param may be either a single string of the format "key=value" or a + dict of key/value pairs. + + This argument ensures that the view will only be called when the + :term:`request` has key/value pairs in its :term:`matchdict` that equal + those supplied in the predicate. e.g. ``match_param="action=edit" would + require the ``action`` parameter in the :term:`matchdict` match the right + hande side of the expression (``edit``) for the view to "match" the current + request. + + If the ``match_param`` is a dict, every key/value pair must match for the + predicate to pass. + + If ``match_param`` is not supplied, the view will be invoked without + consideration of the keys and values in ``request.matchdict``. + ``containment`` This value should be a reference to a Python class or :term:`interface` that a parent object in the context resource's :term:`lineage` must provide |
