From 8741e9a0e11adbbf58d360f115fb6ad99a76a76e Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 22 Apr 2013 21:08:00 +0200 Subject: no need to link to a chapter that follows immediately --- docs/narr/renderers.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'docs/narr/renderers.rst') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index b4eb95186..9f7390449 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -38,9 +38,7 @@ object from a view that is configured with a renderer, the renderer is bypassed entirely. Various types of renderers exist, including serialization renderers -and renderers which use templating systems. See also -:ref:`views_which_use_a_renderer`. - +and renderers which use templating systems. .. index:: single: renderer -- cgit v1.2.3 From 8104c862d38c4b823fe913b4a7c04161ebba5bbb Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 22 Apr 2013 21:12:00 +0200 Subject: simplify explanation The sentence was simply too long-winded (and not too clear). --- docs/narr/renderers.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs/narr/renderers.rst') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index 9f7390449..9d6509b78 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -33,8 +33,7 @@ by the view must be compatible with the particular kind of renderer used, or an error may occur during view invocation. One exception exists: it is *always* OK to return a Response object, even -when a ``renderer`` is configured. If a view callable returns a response -object from a view that is configured with a renderer, the renderer is +when a ``renderer`` is configured. In such cases, the renderer is bypassed entirely. Various types of renderers exist, including serialization renderers -- cgit v1.2.3 From 61b021633fd6d5e9a5773f5409858b3998e48ca0 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 22 Apr 2013 21:18:06 +0200 Subject: grammar --- docs/narr/renderers.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/narr/renderers.rst') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index b4eb95186..8c88fd055 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -51,8 +51,8 @@ and renderers which use templating systems. See also Writing View Callables Which Use a Renderer ------------------------------------------- -As we've seen, view callables needn't always return a Response object. -Instead, they may return an arbitrary Python object, with the expectation +As we've seen, a view callable needn't always return a Response object. +Instead, it may return an arbitrary Python object, with the expectation that a :term:`renderer` will convert that object into a response instance on your behalf. Some renderers use a templating system; other renderers use object serialization techniques. -- cgit v1.2.3 From 6ce39f11b76dc599dfc897eab43bcf236b26c5d5 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 22 Apr 2013 22:43:55 +0300 Subject: remove redundant text Also, this fact has already been explained in the chapter, so mention that. --- docs/narr/renderers.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'docs/narr/renderers.rst') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index b4eb95186..bcab0e3f4 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -80,12 +80,10 @@ response attributes (such as headers and the HTTP status code) by attaching a property to the ``request.response`` attribute. See :ref:`request_response_attr`. -If the :term:`view callable` associated with a :term:`view configuration` -returns a Response object directly, any renderer associated with the view -configuration is ignored, and the response is passed back to :app:`Pyramid` -unchanged. For example, if your view callable returns an instance of the -:class:`pyramid.response.Response` class as a response, no renderer -will be employed. +As already mentioned, if the :term:`view callable` associated with a +:term:`view configuration` returns a Response object (or its instance), +any renderer associated with the view configuration is ignored, +and the response is passed back to :app:`Pyramid` unchanged. For example: .. code-block:: python :linenos: -- cgit v1.2.3 From e8f87a048cf7cc4ac8673dd15d5743afa63e2fbb Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Mon, 22 Apr 2013 23:25:12 +0300 Subject: remove redundancy --- docs/narr/renderers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/narr/renderers.rst') diff --git a/docs/narr/renderers.rst b/docs/narr/renderers.rst index b4eb95186..2ebf9b20e 100644 --- a/docs/narr/renderers.rst +++ b/docs/narr/renderers.rst @@ -140,7 +140,7 @@ used in the ``renderer`` attribute of view configurations. ``string``: String Renderer ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``string`` renderer is a renderer which renders a view callable result to +The ``string`` renderer renders a view callable result to a string. If a view callable returns a non-Response object, and the ``string`` renderer is associated in that view's configuration, the result will be to run the object through the Python ``str`` function to generate a -- cgit v1.2.3