summaryrefslogtreecommitdiff
path: root/docs/narr/views.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-11-24 20:49:16 +0000
committerChris McDonough <chrism@agendaless.com>2009-11-24 20:49:16 +0000
commit13c923f6eaf56a49897af75e14c1f70d1b26c75b (patch)
treec78bfdd395b7c3f676b462122d0a15709052ed98 /docs/narr/views.rst
parent84630d3576dc7a6d6c66fdf191bc377402eef743 (diff)
downloadpyramid-13c923f6eaf56a49897af75e14c1f70d1b26c75b.tar.gz
pyramid-13c923f6eaf56a49897af75e14c1f70d1b26c75b.tar.bz2
pyramid-13c923f6eaf56a49897af75e14c1f70d1b26c75b.zip
Docs updates.
Diffstat (limited to 'docs/narr/views.rst')
-rw-r--r--docs/narr/views.rst30
1 files changed, 27 insertions, 3 deletions
diff --git a/docs/narr/views.rst b/docs/narr/views.rst
index 2e574cb14..566ef765a 100644
--- a/docs/narr/views.rst
+++ b/docs/narr/views.rst
@@ -574,10 +574,34 @@ acts as a :mod:`repoze.bfg` view. All ZCML attributes (save for the
the same thing.
To make :mod:`repoze.bfg` process your ``@bfg_view`` declarations, you
-*must* insert the following boilerplate into your application's
-``configure.zcml``::
+*must* do one of the following:
- <scan package="."/>
+- If you are using :term:`ZCML`, insert the following boilerplate into
+ your application's ``configure.zcml``:
+
+ .. code-block:: xml
+ :linenos:
+
+ <scan package="."/>
+
+- If you are using :term:`imperative configuration`, use the ``scan``
+ method of the ``Configurator`` object:
+
+ .. code-block:: python
+ :linenos:
+
+ config.scan()
+
+.. note:: See :ref:`configuration_module` for additional API arguments
+ to the ``Configurator.scan`` method. For example, the ``scan``
+ method allows you to supply a ``package`` argument to better
+ control exactly *which* code will be scanned. This is the same
+ value implied by the ``package`` attribute of the ZCML ``<scan>``
+ directive.
+
+Please see :ref:`scanning_chapter` for more information about what
+happens when code is scanned for configuration declarations resulting
+from use of decorators like ``@bfg_view``.
After you do so, you will not need to use any other ZCML to configure
:mod:`repoze.bfg` view declarations. Instead, you will be able to use