From 314283a5bec3159d5a0c7e4d7028a0feecd47fa0 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 16 Jan 2011 16:39:54 -0500 Subject: document 'includeme' --- docs/narr/advconfig.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'docs/narr/advconfig.rst') diff --git a/docs/narr/advconfig.rst b/docs/narr/advconfig.rst index f8b3ee191..c983bbb57 100644 --- a/docs/narr/advconfig.rst +++ b/docs/narr/advconfig.rst @@ -338,6 +338,23 @@ Instead, use :meth:`pyramid.config.Configuration.include`: Using ``include`` rather than calling the function directly will allow :ref:`automatic_conflict_resolution` to work. +:meth:`pyramid.config.Configuration.include` can also accept a :term:`module` +as an argument: + +.. code-block:: python + :linenos: + + import myapp + + config.include(myapp) + +For this to work properly, the ``myapp`` module must contain a callable with +the special name ``includeme``, which should perform configuration (like the +``add_routes`` callable we showed above as an example). + +:meth:`pyramid.config.Configuration.include` can also accept a :term:`dotted +Python name` to a function or a module. + .. note: See :ref:`the_include_tag` for a declarative alternative to :meth:`pyramid.config.Configurator.include`. -- cgit v1.2.3 From 2fa5764cb1fd001550ae7c985333718667b86b1c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 16 Jan 2011 17:41:10 -0500 Subject: - The ``pylons_minimal``, ``pylons_basic`` and ``pylons_sqla`` paster templates were removed. Use ``pyramid_sqla`` (available from PyPI) as a generic replacement for Pylons-esque development. - All references to ``add_handler`` and the ``handler`` ZCML directive have been removed from the docs, and stubs which point to ``pylons_handlers`` package have replaced them. --- docs/narr/advconfig.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'docs/narr/advconfig.rst') diff --git a/docs/narr/advconfig.rst b/docs/narr/advconfig.rst index c983bbb57..eb9b70b12 100644 --- a/docs/narr/advconfig.rst +++ b/docs/narr/advconfig.rst @@ -301,9 +301,6 @@ These are the methods of the configurator which provide conflict detection: Some other methods of the configurator also indirectly provide conflict detection, because they're implemented in terms of conflict-aware methods: -- :meth:`~pyramid.config.Configurator.add_handler`, a frontend for - ``add_route`` and ``add_view``. - - :meth:`~pyramid.config.Configurator.add_route` does a second type of conflict detection when a ``view`` parameter is passed (it calls ``add_view``). @@ -404,8 +401,7 @@ used, two-phase configuration is disabled, and configuration statements must be ordered in dependency order. Some configuration methods, such as -:meth:`pyramid.config.Configurator.add_route` and -:meth:`pyramid.config.Configurator.add_handler` have internal ordering +:meth:`pyramid.config.Configurator.add_route` have internal ordering constraints: they routes they imply require relative ordering. Such ordering constraints are not absolved by two-phase configuration. Routes are still added in configuration execution order. -- cgit v1.2.3