summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-08-29 13:11:45 -0400
committerChris McDonough <chrism@plope.com>2011-08-29 13:11:45 -0400
commitc0e6e69eb75ae042f0db3b98a5e064a94235837a (patch)
tree493c00067b0c829edfe5250a3f65fc52eba79e59
parentec98cbf480a7a931c22f1f622536334494740698 (diff)
downloadpyramid-c0e6e69eb75ae042f0db3b98a5e064a94235837a.tar.gz
pyramid-c0e6e69eb75ae042f0db3b98a5e064a94235837a.tar.bz2
pyramid-c0e6e69eb75ae042f0db3b98a5e064a94235837a.zip
add match_param to the narrative docs
-rw-r--r--docs/narr/viewconfig.rst19
-rw-r--r--pyramid/config/views.py9
2 files changed, 24 insertions, 4 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
diff --git a/pyramid/config/views.py b/pyramid/config/views.py
index 06d6e901e..7e657905a 100644
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -786,11 +786,12 @@ class ViewsConfiguratorMixin(object):
or a dict of key/value pairs.
A view declaration with this argument ensures that the view will
- only be called when the :term:`request` has key/value pairs in
- the ``matchdict`` that equal those supplied in the predicate.
+ 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 ``matchdict`` match the right hande side of the
- expression (``edit``) for the view to "match" the current request.
+ 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.