From d89aee7640b1e01a7dda4e603e87461074fbbdd7 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 5 Sep 2010 22:39:20 +0000 Subject: - Each of the follow methods of the Configurator now allow the below-named arguments to be passed as "dotted name strings" (e.g. "foo.bar.baz") rather than as actual implementation objects that must be imported: setup_registry root_factory, authentication_policy, authorization_policy, debug_logger, locale_negotiator, request_factory, renderer_globals_factory add_subscriber subscriber, iface derive_view view add_view view, for_, context, request_type, containment add_route() view, view_for, factory, for_, view_context scan package add_renderer factory set_forbidden_view view set_notfound_view view set_request_factory factory set_renderer_globals_factory() factory set_locale_negotiator negotiator testing_add_subscriber event_iface --- docs/narr/views.rst | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'docs/narr/views.rst') diff --git a/docs/narr/views.rst b/docs/narr/views.rst index eebaa63de..4d60f8a9e 100644 --- a/docs/narr/views.rst +++ b/docs/narr/views.rst @@ -620,7 +620,8 @@ For example, to add a renderer which renders views which have a The first argument is the renderer name. The second argument is a reference to an implementation of a - :term:`renderer factory`. + :term:`renderer factory` or a :term:`dotted Python name` referring + to such an object. Adding a New Renderer +++++++++++++++++++++ @@ -1537,8 +1538,8 @@ Or replaces the need to add this imperative configuration stanza: .. ignore-next-block .. code-block:: python - config.add_view(name='my_view', request_method='POST', context=MyModel, - permission='read') + config.add_view('.views.my_view', name='my_view', request_method='POST', + context=MyModel, permission='read') All arguments to ``bfg_view`` may be omitted. For example: @@ -1748,6 +1749,12 @@ example: # repoze.bfg.configuration.Configurator class config.add_view(hello_world, name='hello.html') +The first argument, ``view``, is required. It must either be a Python +object which is the view itself or a :term:`dotted Python name` to +such an object. All other arguments are optional. See +:meth:`repoze.bfg.configuration.Configurator.add_view` for more +information. + .. index:: single: model interfaces -- cgit v1.2.3