summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2018-10-10 00:04:43 -0500
committerMichael Merickel <michael@merickel.org>2018-10-10 00:04:43 -0500
commit4a9f4f43684c3a754f43935b97013057340c305d (patch)
tree87de0a50faa947baaa10d46ff4a1c3b0e40e08bb /docs
parentc314e31223307d7fd739e0bc41519ae6d1d323d3 (diff)
downloadpyramid-4a9f4f43684c3a754f43935b97013057340c305d.tar.gz
pyramid-4a9f4f43684c3a754f43935b97013057340c305d.tar.bz2
pyramid-4a9f4f43684c3a754f43935b97013057340c305d.zip
deprecate range support
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/viewconfig.rst14
1 files changed, 4 insertions, 10 deletions
diff --git a/docs/narr/viewconfig.rst b/docs/narr/viewconfig.rst
index c44109661..238599528 100644
--- a/docs/narr/viewconfig.rst
+++ b/docs/narr/viewconfig.rst
@@ -1093,23 +1093,17 @@ Default Accept Ordering
~~~~~~~~~~~~~~~~~~~~~~~
:app:`Pyramid` will always sort multiple views with the same ``(name, context, route_name)`` first by the specificity of the ``accept`` offer.
-This means that ``text/plain`` will always be offered before ``text/*``.
-Similarly ``text/plain;charset=utf8`` will always be offered before ``text/plain``.
-The following order is always preserved between the following offers (more preferred to less preferred):
+For any set of media type offers with the same ``type/subtype``, the offers with params will weigh more than the bare ``type/subtype`` offer.
+This means that ``text/plain;charset=utf8`` will always be offered before ``text/plain``.
-- ``type/subtype;params``
-- ``type/subtype``
-- ``type/*``
-- ``*/*``
-
-Within each of these levels of specificity, the ordering is ambiguous and may be controlled using :meth:`pyramid.config.Configurator.add_accept_view_order`. For example, to sort ``text/plain`` higher than ``text/html`` and to prefer a ``charset=utf8`` versus a ``charset=latin-1`` within the ``text/plain`` media type:
+By default, within a given ``type/subtype``, the order of offers is ambiguous. For example, ``text/plain;charset=utf8`` versus ``text/plain;charset=latin1`` are sorted in an unspecified way. Similarly, between media types the order is also unspecified other than the defaults described below. For example, ``image/jpeg`` versus ``image/png`` versus ``application/pdf``. In these cases, the ordering may be controlled using :meth:`pyramid.config.Configurator.add_accept_view_order`. For example, to sort ``text/plain`` higher than ``text/html`` and to prefer a ``charset=utf8`` versus a ``charset=latin-1`` within the ``text/plain`` media type:
.. code-block:: python
config.add_accept_view_order('text/plain', weighs_more_than='text/html')
config.add_accept_view_order('text/plain;charset=utf8', weighs_more_than='text/plain;charset=latin-1')
-It is an error to try and sort accept headers across levels of specificity. You can only sort a ``type/subtype`` against another ``type/subtype``, not against a ``type/*``. That ordering is a hard requirement.
+It is an error to try and sort accept headers across levels of specificity. You can only sort a ``type/subtype`` against another ``type/subtype``, not against a ``type/subtype;params``. That ordering is a hard requirement.
By default, :app:`Pyramid` defines a very simple priority ordering for views that prefers human-readable responses over JSON: