summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-10-13 19:02:01 -0400
committerChris McDonough <chrism@plope.com>2012-10-13 19:02:01 -0400
commit06a904f88a64dc0c12b8ed7803287bac8786ff67 (patch)
treef4f820a4d01b5d6288ef3e0ddec8b0c0970e417c
parentb1d2a373d74a433b247ea2f1186f1e314244490c (diff)
downloadpyramid-06a904f88a64dc0c12b8ed7803287bac8786ff67.tar.gz
pyramid-06a904f88a64dc0c12b8ed7803287bac8786ff67.tar.bz2
pyramid-06a904f88a64dc0c12b8ed7803287bac8786ff67.zip
add docs and changelog note
-rw-r--r--CHANGES.txt10
-rw-r--r--docs/narr/viewconfig.rst11
-rw-r--r--pyramid/config/predicates.py2
-rw-r--r--pyramid/config/views.py9
4 files changed, 21 insertions, 11 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index e40401528..613be1b80 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,9 +1,19 @@
Next release
============
+Features
+--------
+
+- Allow multiple values to be specified to the ``request_param`` view/route
+ predicate as a sequence. Previously only a single string value was allowed.
+ See https://github.com/Pylons/pyramid/pull/705
+
Bug Fixes
---------
+- The match_param predicate's text method was fixed to sort its values.
+ Part of https://github.com/Pylons/pyramid/pull/705
+
- 1.4a ``pyramid.scripting.prepare`` behaved differently than 1.3 series
function of same name. In particular, if passed a request, it would not
set the ``registry`` attribute of the request like 1.3 did. A symptom
diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst
index f65435cc6..3c7897969 100644
--- a/docs/narr/viewconfig.rst
+++ b/docs/narr/viewconfig.rst
@@ -290,12 +290,13 @@ configured view.
of the ``REQUEST_METHOD`` of the :term:`WSGI` environment.
``request_param``
- This value can be any string. A view declaration with this argument
- ensures that the view will only be called when the :term:`request` has a
- key in the ``request.params`` dictionary (an HTTP ``GET`` or ``POST``
- variable) that has a name which matches the supplied value.
+ This value can be any string or a sequence of strings. A view declaration
+ with this argument ensures that the view will only be called when the
+ :term:`request` has a key in the ``request.params`` dictionary (an HTTP
+ ``GET`` or ``POST`` variable) that has a name which matches the a
+ supplied value.
- If the value supplied has a ``=`` sign in it,
+ If any value supplied has a ``=`` sign in it,
e.g. ``request_param="foo=123"``, then the key (``foo``) must both exist
in the ``request.params`` dictionary, *and* the value must match the right
hand side of the expression (``123``) for the view to "match" the current
diff --git a/pyramid/config/predicates.py b/pyramid/config/predicates.py
index 2b2b57bc3..100c9454e 100644
--- a/pyramid/config/predicates.py
+++ b/pyramid/config/predicates.py
@@ -1,7 +1,5 @@
import re
-from pyramid.compat import is_nonstr_iter
-
from pyramid.exceptions import ConfigurationError
from pyramid.traversal import (
diff --git a/pyramid/config/views.py b/pyramid/config/views.py
index 9ace96c1d..15263ad04 100644
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -904,11 +904,12 @@ class ViewsConfiguratorMixin(object):
request_param
- This value can be any string. A view declaration with this
- argument ensures that the view will only be called when the
- :term:`request` has a key in the ``request.params``
+ This value can be any string or any sequence of strings. A view
+ declaration with this argument ensures that the view will only be
+ called when the :term:`request` has a key in the ``request.params``
dictionary (an HTTP ``GET`` or ``POST`` variable) that has a
- name which matches the supplied value. If the value
+ name which matches the supplied value (if the value is a string)
+ or values (if the value is a tuple). If any value
supplied has a ``=`` sign in it,
e.g. ``request_param="foo=123"``, then the key (``foo``)
must both exist in the ``request.params`` dictionary, *and*