From 9d33a1f071df207878b45df2cd5512dae1087bb3 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Sun, 7 Nov 2010 18:26:34 +0200 Subject: Minor documentation fixes. --- docs/narr/static.rst | 2 +- docs/narr/templates.rst | 4 ++-- docs/narr/views.rst | 15 ++++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/narr/static.rst b/docs/narr/static.rst index a60b84445..90ee61f6c 100644 --- a/docs/narr/static.rst +++ b/docs/narr/static.rst @@ -120,7 +120,7 @@ imperative configuration for the same purpose. Generating Static Resource URLs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When a :meth:`pyramid.configuration.Configurator.add_static_view`` method is +When a :meth:`pyramid.configuration.Configurator.add_static_view` method is used to register a static resource directory, a special helper API named :func:`pyramid.static_url` can be used to generate the appropriate URL for a package resource that lives in one of the directories named by the static diff --git a/docs/narr/templates.rst b/docs/narr/templates.rst index 01227b6de..9722db6b2 100644 --- a/docs/narr/templates.rst +++ b/docs/narr/templates.rst @@ -212,7 +212,7 @@ response object returned by .. code-block:: python :linenos: - from pyramid.renderers.render_to_response + from pyramid.renderers import render_to_response def sample_view(request): response = render_to_response('templates/foo.pt', @@ -380,7 +380,7 @@ within the view before returning the dictionary. See :ref:`response_request_attrs` for more information. The same set of system values are provided to templates rendered via a -rendere view configuration as those provided to templates rendered +renderer view configuration as those provided to templates rendered imperatively. See :ref:`renderer_system_values`. diff --git a/docs/narr/views.rst b/docs/narr/views.rst index 02ae2a62f..ebd690330 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -228,8 +228,9 @@ You don't need to always use :class:`pyramid.response.Response` to represent a response. :mod:`pyramid` provides a range of different "exception" classes which can act as response objects too. For example, an instance of the class :class:`pyramid.httpexceptions.HTTPFound` is also a valid response object (see -:ref:`http_redirect`). A view can actually any object that has the following -attributes (these attributes form the notional "Pyramid Response interface"): +:ref:`http_redirect`). A view can actually return any object that has the +following attributes (these attributes form the notional "Pyramid Response +interface"): status The HTTP status code (including the name) for the response as a string. @@ -695,11 +696,11 @@ For example, to add a renderer which renders views which have a config.add_renderer('.jinja2', 'mypackage.MyJinja2Renderer') - The first argument is the renderer name. +The first argument is the renderer name. - The second argument is a reference to an implementation of a - :term:`renderer factory` or a :term:`dotted Python name` referring - to such an object. +The second argument is a reference to an implementation of a +:term:`renderer factory` or a :term:`dotted Python name` referring +to such an object. .. _adding_a_renderer: @@ -1068,7 +1069,7 @@ decode already-decoded (``unicode``) values obtained from firstname = request.params['firstname'].decode('utf-8') lastname = request.params['lastname'].decode('utf-8') -For implicit decoding to work reliably, youshould ensure that every form you +For implicit decoding to work reliably, you should ensure that every form you render that posts to a :mod:`pyramid` view is rendered via a response that has a ``;charset=UTF-8`` in its ``Content-Type`` header; or, as in the form above, with a ``meta http-equiv`` tag that implies that the charset is UTF-8 within -- cgit v1.2.3