diff options
| author | Casey Duncan <casey.duncan@gmail.com> | 2010-11-30 20:08:33 -0700 |
|---|---|---|
| committer | Casey Duncan <casey.duncan@gmail.com> | 2010-11-30 20:08:33 -0700 |
| commit | 208c26258480a8b1403a57099bb4973ef4f25308 (patch) | |
| tree | a371c3653d3ca07408d815b76bc975a70902f4b8 /docs | |
| parent | e62692b5cefa25541d65e5c5bf4bb463f51396a9 (diff) | |
| download | pyramid-208c26258480a8b1403a57099bb4973ef4f25308.tar.gz pyramid-208c26258480a8b1403a57099bb4973ef4f25308.tar.bz2 pyramid-208c26258480a8b1403a57099bb4973ef4f25308.zip | |
simplify paragraph about dotted view names
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/views.rst | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/docs/narr/views.rst b/docs/narr/views.rst index d92a88d87..f865ba013 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -792,13 +792,12 @@ renderer by specifying ``amf`` in the ``renderer`` attribute of a def myview(request): return {'Hello':'world'} -At startup time, when a :term:`view configuration` is encountered -which has a ``name`` argument that does not contain a dot, such as the -above ``amf`` is encountered, the full value of the ``name`` attribute -is used to construct a renderer from the associated renderer factory. -In this case, the view configuration will create an instance of an -``AMFRenderer`` for each view configuration which includes ``amf`` as -its renderer value. The ``name`` passed to the ``AMFRenderer`` +At startup time, when a :term:`view configuration` is encountered, which +has a ``name`` attribute that does not contain a dot, the full ``name`` +value is used to construct a renderer from the associated renderer +factory. In this case, the view configuration will create an instance +of an ``AMFRenderer`` for each view configuration which includes ``amf`` +as its renderer value. The ``name`` passed to the ``AMFRenderer`` constructor will always be ``amf``. Here's an example of the registration of a more complicated renderer @@ -824,17 +823,17 @@ the ``renderer`` attribute of a :term:`view configuration`: def myview(request): return {'Hello':'world'} -When a :term:`view configuration` which has a ``name`` attribute that does -contain a dot, such as ``templates/mytemplate.jinja2`` above is encountered -at startup time, the value of the name attribute is split on its final dot. -The second element of the split is typically the filename extension. This -extension is used to look up a renderer factory for the configured view. -Then the value of ``renderer`` is passed to the factory to create a renderer -for the view. In this case, the view configuration will create an instance -of a ``Jinja2Renderer`` for each view configuration which includes anything -ending with ``.jinja2`` as its ``renderer`` value. The ``name`` passed to -the ``Jinja2Renderer`` constructor will be whatever the user passed as -``renderer=`` to the view configuration. +When a :term:`view configuration` is encountered at startup time, which +has a ``name`` attribute that does contain a dot, the value of the name +attribute is split on its final dot. The second element of the split is +typically the filename extension. This extension is used to look up a +renderer factory for the configured view. Then the value of +``renderer`` is passed to the factory to create a renderer for the view. +In this case, the view configuration will create an instance of a +``Jinja2Renderer`` for each view configuration which includes anything +ending with ``.jinja2`` in its ``renderer`` value. The ``name`` passed +to the ``Jinja2Renderer`` constructor will be the full value that was +set as ``renderer=`` in the view configuration. See also :ref:`renderer_directive` and :meth:`pyramid.configuration.Configurator.add_renderer`. |
