Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation/accept #1487

Merged
merged 6 commits into from
Feb 6, 2015
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reference this PR pretty please.


- Removed logging configuration from Quick Tutorial ini files except for
scaffolding- and logging-related chapters to avoid needing to explain it too
early.
Expand Down
25 changes: 12 additions & 13 deletions pyramid/config/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ def add_route(self,

.. 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
Expand Down Expand Up @@ -220,19 +232,6 @@ def add_route(self,
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
Expand Down
23 changes: 12 additions & 11 deletions pyramid/config/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,18 @@ def myview(request):
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
Expand Down Expand Up @@ -941,17 +953,6 @@ def myview(request):
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
Expand Down