summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2015-02-06 00:16:56 -0600
committerMichael Merickel <michael@merickel.org>2015-02-06 00:16:56 -0600
commit04ef03eb425945a4e3d15f7a86a13f7e7be68948 (patch)
tree6d3cc77ac2bd6bb8ca3518a229336b13e040f40b
parent42075618568881a36d9fb03812a0e651d1c084ce (diff)
parentf176630ebd9848173e6cc748f361b4ce9acf76f3 (diff)
downloadpyramid-04ef03eb425945a4e3d15f7a86a13f7e7be68948.tar.gz
pyramid-04ef03eb425945a4e3d15f7a86a13f7e7be68948.tar.bz2
pyramid-04ef03eb425945a4e3d15f7a86a13f7e7be68948.zip
Merge pull request #1487 from bertjwregeer/documentation/accept
Documentation/accept
-rw-r--r--CHANGES.txt7
-rw-r--r--pyramid/config/routes.py25
-rw-r--r--pyramid/config/views.py23
3 files changed, 31 insertions, 24 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 22c7a20c2..832a2c216 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -130,6 +130,13 @@ Deprecations
Docs
----
+- Moved the documentation for ``accept`` on ``Configurator.add_view`` to no
+ longer be part of the predicate list. See
+ https://github.com/Pylons/pyramid/issues/1391 for a bug report stating
+ ``not_`` was failing on ``accept``. Discussion with @mcdonc led to the
+ conclusion that it should not be documented as a predicate.
+ See https://github.com/Pylons/pyramid/pull/1487 for this PR
+
- Removed logging configuration from Quick Tutorial ini files except for
scaffolding- and logging-related chapters to avoid needing to explain it too
early.
diff --git a/pyramid/config/routes.py b/pyramid/config/routes.py
index 509955cdd..24f38a4fd 100644
--- a/pyramid/config/routes.py
+++ b/pyramid/config/routes.py
@@ -138,6 +138,18 @@ class RoutesConfiguratorMixin(object):
.. versionadded:: 1.1
+ accept
+
+ This value represents a match query for one or more mimetypes in the
+ ``Accept`` HTTP request header. If this value is specified, it must
+ be in one of the following forms: a mimetype match token in the form
+ ``text/plain``, a wildcard mimetype match token in the form
+ ``text/*`` or a match-all wildcard mimetype match token in the form
+ ``*/*``. If any of the forms matches the ``Accept`` header of the
+ request, or if the ``Accept`` header isn't set at all in the request,
+ this will match the current route. If this does not match the
+ ``Accept`` header of the request, route matching continues.
+
Predicate Arguments
pattern
@@ -220,19 +232,6 @@ class RoutesConfiguratorMixin(object):
case of the header name is not significant. If this
predicate returns ``False``, route matching continues.
- accept
-
- This value represents a match query for one or more
- mimetypes in the ``Accept`` HTTP request header. If this
- value is specified, it must be in one of the following
- forms: a mimetype match token in the form ``text/plain``, a
- wildcard mimetype match token in the form ``text/*`` or a
- match-all wildcard mimetype match token in the form ``*/*``.
- If any of the forms matches the ``Accept`` header of the
- request, or if the ``Accept`` header isn't set at all in the
- request, this predicate will be true. If this predicate
- returns ``False``, route matching continues.
-
effective_principals
If specified, this value should be a :term:`principal` identifier or
diff --git a/pyramid/config/views.py b/pyramid/config/views.py
index c01b72e12..1f69d7e0b 100644
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -841,6 +841,18 @@ class ViewsConfiguratorMixin(object):
very useful for 'civilians' who are just developing stock Pyramid
applications. Pay no attention to the man behind the curtain.
+ accept
+
+ This value represents a match query for one or more mimetypes in the
+ ``Accept`` HTTP request header. If this value is specified, it must
+ be in one of the following forms: a mimetype match token in the form
+ ``text/plain``, a wildcard mimetype match token in the form
+ ``text/*`` or a match-all wildcard mimetype match token in the form
+ ``*/*``. If any of the forms matches the ``Accept`` header of the
+ request, or if the ``Accept`` header isn't set at all in the request,
+ this will match the current view. If this does not match the
+ ``Accept`` header of the request, view matching continues.
+
Predicate Arguments
name
@@ -941,17 +953,6 @@ class ViewsConfiguratorMixin(object):
This is useful for detecting AJAX requests issued from
jQuery, Prototype and other Javascript libraries.
- accept
-
- The value of this argument represents a match query for one
- or more mimetypes in the ``Accept`` HTTP request header. If
- this value is specified, it must be in one of the following
- forms: a mimetype match token in the form ``text/plain``, a
- wildcard mimetype match token in the form ``text/*`` or a
- match-all wildcard mimetype match token in the form ``*/*``.
- If any of the forms matches the ``Accept`` header of the
- request, this predicate will be true.
-
header
This value represents an HTTP header name or a header