From 1a6fc7062f803b9f15b7677db9a9257a4f00bfcb Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 14 Jun 2011 02:36:07 -0400 Subject: - Added new add_response_adapter method to Configurator. - Fix Configurator docstring wrt exception responses. - Speed up registry.queryAdapterOrSelf --- docs/api/config.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 2b9d7bcef..274ee0292 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -40,6 +40,8 @@ .. automethod:: add_renderer(name, factory) + .. automethod:: add_response_adapter + .. automethod:: add_route .. automethod:: add_static_view(name, path, cache_max_age=3600, permission='__no_permission_required__') -- cgit v1.2.3 From b7f33b5fdd062e007723d0eb60001442f35c0bf7 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 1 Jul 2011 01:24:39 -0400 Subject: - Deprecated the ``set_renderer_globals_factory`` method of the Configurator and the ``renderer_globals`` Configurator constructor parameter. --- docs/api/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 274ee0292..71ef4a746 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -74,7 +74,7 @@ .. automethod:: set_request_factory - .. automethod:: set_renderer_globals_factory + .. automethod:: set_renderer_globals_factory(factory) .. automethod:: set_view_mapper -- cgit v1.2.3 From 37e3bebf0165ac5f32c82c0bc87296e0ca5fefd3 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Mon, 11 Jul 2011 05:40:06 -0500 Subject: Added some docs for make_request and global_registries. --- docs/api/config.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 71ef4a746..d021412b8 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -86,3 +86,13 @@ .. automethod:: testing_add_renderer + .. attribute:: global_registries + + A set of registries that have been created for :app:`Pyramid` + applications. The object itself supports iteration and has a + ``last`` property containing the last registry loaded. + + The registries contained in this object are stored as weakrefs, + thus they will only exist for the lifetime of the actual + applications for which they are being used. + -- cgit v1.2.3 From c515d77de5b2f62727251ebc32d1292e67811771 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 15 Jul 2011 10:13:07 -0400 Subject: - get_root2 -> prepare - change prepare return value to a dict, and return the registry, request, etc - various docs and changelog entries. --- docs/api/config.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index d021412b8..2c394ac41 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -88,9 +88,11 @@ .. attribute:: global_registries - A set of registries that have been created for :app:`Pyramid` - applications. The object itself supports iteration and has a - ``last`` property containing the last registry loaded. + The set of registries that have been created for :app:`Pyramid` + applications, one per each call to + :meth:`pyramid.config.Configurator.make_app` in the current process. The + object itself supports iteration and has a ``last`` property containing + the last registry loaded. The registries contained in this object are stored as weakrefs, thus they will only exist for the lifetime of the actual -- cgit v1.2.3 From 7a5f5612791210081db430aa707ed146a8e2c0e9 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 15 Jul 2011 15:40:53 -0400 Subject: remove bogus information about route_name, refer to the right method of Configurator when describing global_registries, add http_cache newness warning --- docs/api/config.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 2c394ac41..96e955388 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -90,9 +90,9 @@ The set of registries that have been created for :app:`Pyramid` applications, one per each call to - :meth:`pyramid.config.Configurator.make_app` in the current process. The - object itself supports iteration and has a ``last`` property containing - the last registry loaded. + :meth:`pyramid.config.Configurator.make_wsgi_app` in the current + process. The object itself supports iteration and has a ``last`` + property containing the last registry loaded. The registries contained in this object are stored as weakrefs, thus they will only exist for the lifetime of the actual -- cgit v1.2.3 From af2323bcb169653dd2d76d7c40909fd881041beb Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 24 Jul 2011 01:01:38 -0400 Subject: first cut --- docs/api/config.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 96e955388..21e2b828d 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -78,6 +78,8 @@ .. automethod:: set_view_mapper + .. automethod:: add_request_handler + .. automethod:: testing_securitypolicy .. automethod:: testing_resources -- cgit v1.2.3 From 1311321d454ded6226b09f929ebc9e4aa2c12771 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 6 Aug 2011 18:58:26 -0400 Subject: add tweens module, add docs for ptweens and tweens to hooks --- docs/api/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 21e2b828d..1a9bb6ba4 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -78,7 +78,7 @@ .. automethod:: set_view_mapper - .. automethod:: add_request_handler + .. automethod:: add_tween .. automethod:: testing_securitypolicy -- cgit v1.2.3 From fecefff5f0c3a6aaafdd43d902aaed15edb8559e Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Tue, 9 Aug 2011 23:26:12 -0500 Subject: Added the `pyramid.security.NO_PERMISSION_REQUIRED` constant. Removed the undocumented version from pyramid.interfaces. --- docs/api/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 1a9bb6ba4..30c541905 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -44,7 +44,7 @@ .. automethod:: add_route - .. automethod:: add_static_view(name, path, cache_max_age=3600, permission='__no_permission_required__') + .. automethod:: add_static_view(name, path, cache_max_age=3600, permission=NO_PERMISSION_REQUIRED) .. automethod:: add_settings -- cgit v1.2.3 From 1a42bd45ad6dd066078d6d4997d33208b1bd0c63 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 15 Aug 2011 03:01:51 -0400 Subject: - New methods of the ``pyramid.config.Configurator`` class: ``set_authentication_policy`` and ``set_authorization_policy``. These are meant to be consumed mostly by add-on authors. --- docs/api/config.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 30c541905..de054d7ce 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -78,6 +78,10 @@ .. automethod:: set_view_mapper + .. automethod:: set_authentication_policy + + .. automethod:: set_authorization_policy + .. automethod:: add_tween .. automethod:: testing_securitypolicy -- cgit v1.2.3 From ea824f6f1ceaae4b922b6cff5320bb1c19cbacd5 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 18 Aug 2011 22:15:11 -0400 Subject: - Pyramid no longer eagerly commits some default configuration statements at Configurator construction time, which permits values passed in as constructor arguments (e.g. ``authentication_policy`` and ``authorization_policy``) to override the same settings obtained via an "include". --- docs/api/config.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index de054d7ce..d744418b3 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -54,6 +54,8 @@ .. automethod:: add_view + .. automethod:: add_tween + .. automethod:: derive_view .. automethod:: make_wsgi_app() @@ -74,6 +76,8 @@ .. automethod:: set_request_factory + .. automethod:: set_root_factory + .. automethod:: set_renderer_globals_factory(factory) .. automethod:: set_view_mapper @@ -82,8 +86,6 @@ .. automethod:: set_authorization_policy - .. automethod:: add_tween - .. automethod:: testing_securitypolicy .. automethod:: testing_resources -- cgit v1.2.3 From adfc236ef6b448de6970d5c9db53bf40eab6e056 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 19 Aug 2011 09:20:29 -0400 Subject: review and fix configurator docs in random places --- docs/api/config.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index d744418b3..a8c193b60 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -5,7 +5,7 @@ .. automodule:: pyramid.config - .. autoclass:: Configurator(registry=None, package=None, settings=None, root_factory=None, authentication_policy=None, authorization_policy=None, renderers=DEFAULT_RENDERERS, debug_logger=None, locale_negotiator=None, request_factory=None, renderer_globals_factory=None, default_permission=None, session_factory=None, autocommit=False) + .. autoclass:: Configurator .. attribute:: registry @@ -36,9 +36,9 @@ .. automethod:: absolute_asset_spec - .. automethod:: setup_registry(settings=None, root_factory=None, authentication_policy=None, renderers=DEFAULT_RENDERERS, debug_logger=None, locale_negotiator=None, request_factory=None, renderer_globals_factory=None) + .. automethod:: setup_registry - .. automethod:: add_renderer(name, factory) + .. automethod:: add_renderer .. automethod:: add_response_adapter @@ -64,10 +64,6 @@ .. automethod:: scan - .. automethod:: set_forbidden_view - - .. automethod:: set_notfound_view - .. automethod:: set_locale_negotiator .. automethod:: set_default_permission @@ -78,8 +74,6 @@ .. automethod:: set_root_factory - .. automethod:: set_renderer_globals_factory(factory) - .. automethod:: set_view_mapper .. automethod:: set_authentication_policy @@ -94,6 +88,13 @@ .. automethod:: testing_add_renderer + .. automethod:: set_forbidden_view + + .. automethod:: set_notfound_view + + .. automethod:: set_renderer_globals_factory(factory) + + .. attribute:: global_registries The set of registries that have been created for :app:`Pyramid` -- cgit v1.2.3 From ce5c42f1b832b21405ffd40f61c74a5cfa040e8d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 28 Nov 2011 20:27:14 -0500 Subject: docs --- docs/api/config.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index a8c193b60..9f130b7dc 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -94,6 +94,16 @@ .. automethod:: set_renderer_globals_factory(factory) + .. attribute:: introspector + + The :term:`introspector` associated with this configuration. + + .. attribute:: introspectable + + A shortcut attribute which points to the + :class:`pyramid.registry.Introspectable` class (used during + directives to provide introspection to actions). + .. attribute:: global_registries -- cgit v1.2.3 From 57a0d7765c54031e6ac83881b536712316f22c45 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 30 Nov 2011 12:55:41 -0500 Subject: docs; todo; coverage for Introspector --- docs/api/config.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 9f130b7dc..dbfbb1761 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -94,16 +94,23 @@ .. automethod:: set_renderer_globals_factory(factory) - .. attribute:: introspector - - The :term:`introspector` associated with this configuration. - .. attribute:: introspectable A shortcut attribute which points to the :class:`pyramid.registry.Introspectable` class (used during directives to provide introspection to actions). + This attribute is new as of :app:`Pyramid` 1.3. + + .. attribute:: introspector + + The :term:`introspector` related to this configuration. It is an + instance implementing the :class:`pyramid.interfaces.IIntrospector` + interface. If the Configurator constructor was supplied with an + ``introspector`` argument, this attribute will be that value. + Otherwise, it will be an instance of a default introspector type. + + This attribute is new as of :app:`Pyramid` 1.3. .. attribute:: global_registries -- cgit v1.2.3 From 10320e24cc49644234b2a76a5d393916fd8ce7b3 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Sat, 21 Jan 2012 01:32:06 -0600 Subject: Added set_request_property to the docs. --- docs/api/config.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index dbfbb1761..d16930cc0 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -72,6 +72,8 @@ .. automethod:: set_request_factory + .. automethod:: set_request_property + .. automethod:: set_root_factory .. automethod:: set_view_mapper -- cgit v1.2.3 From 748aad47f90136b151be13f477ed6af1caed0493 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 15 Feb 2012 19:09:08 -0500 Subject: - Add ``pyramid.config.Configurator.set_traverser`` API method. See the Hooks narrative documentation section entitled "Changing the Traverser" for more information. This is not a new feature, it just provides an API for adding a traverser without needing to use the ZCA API. --- docs/api/config.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index d16930cc0..3c5ee563a 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -94,6 +94,8 @@ .. automethod:: set_notfound_view + .. automethod:: set_traverser + .. automethod:: set_renderer_globals_factory(factory) .. attribute:: introspectable -- cgit v1.2.3 From c51896756eeffc7e8c50ad71300ec355ae47465a Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 17 Feb 2012 01:08:42 -0500 Subject: Features -------- - Add ``pyramid.config.Configurator.add_resource_url_adapter`` API method. See the Hooks narrative documentation section entitled "Changing How pyramid.request.Request.resource_url Generates a URL" for more information. This is not a new feature, it just provides an API for adding a resource url adapter without needing to use the ZCA API. - A new interface was added: ``pyramid.interfaces.IResourceURL``. An adapter implementing its interface can be used to override resource URL generation when ``request.resource_url`` is called. This interface replaces the now-deprecated ``pyramid.interfaces.IContextURL`` interface. - The dictionary passed to a resource's ``__resource_url__`` method (see "Overriding Resource URL Generation" in the "Resources" chapter) now contains an ``app_url`` key, representing the application URL generated during ``request.resource_url``. It represents a potentially customized URL prefix, containing potentially custom scheme, host and port information passed by the user to ``request.resource_url``. It should be used instead of ``request.application_url`` where necessary. - The ``request.resource_url`` API now accepts these arguments: ``app_url``, ``scheme``, ``host``, and ``port``. The app_url argument can be used to replace the URL prefix wholesale during url generation. The ``scheme``, ``host``, and ``port`` arguments can be used to replace the respective default values of ``request.application_url`` partially. - A new API named ``request.resource_path`` now exists. It works like ``request.resource_url`` but produces a relative URL rather than an absolute one. - The ``request.route_url`` API now accepts these arguments: ``_app_url``, ``_scheme``, ``_host``, and ``_port``. The ``_app_url`` argument can be used to replace the URL prefix wholesale during url generation. The ``_scheme``, ``_host``, and ``_port`` arguments can be used to replace the respective default values of ``request.application_url`` partially. Backwards Incompatibilities --------------------------- - The ``pyramid.interfaces.IContextURL`` interface has been deprecated. People have been instructed to use this to register a resource url adapter in the "Hooks" chapter to use to influence ``request.resource_url`` URL generation for resources found via custom traversers since Pyramid 1.0. The interface still exists and registering such an adapter still works, but this interface will be removed from the software after a few major Pyramid releases. You should replace it with an equivalent ``pyramid.interfaces.IResourceURL`` adapter, registered using the new ``pyramid.config.Configurator.add_resource_url_adapter`` API. A deprecation warning is now emitted when a ``pyramid.interfaces.IContextURL`` adapter is found when ``request.resource_url`` is called. Misc ---- - Change ``set_traverser`` API name to ``add_traverser``. Ref #438. --- docs/api/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 3c5ee563a..3fc2cfc44 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -94,7 +94,7 @@ .. automethod:: set_notfound_view - .. automethod:: set_traverser + .. automethod:: add_traverser .. automethod:: set_renderer_globals_factory(factory) -- cgit v1.2.3 From 3885448eea74d4c79bf34dae0fb3a7fc767cb85c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 17 Feb 2012 20:58:12 -0500 Subject: docs rearranging / fixing --- docs/api/config.rst | 88 ++++++++++++++++++++++++++++------------------------- 1 file changed, 47 insertions(+), 41 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 3fc2cfc44..87ba94673 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -7,56 +7,27 @@ .. autoclass:: Configurator - .. attribute:: registry - - The :term:`application registry` which holds the configuration - associated with this configurator. - - .. automethod:: begin - - .. automethod:: end - - .. automethod:: hook_zca - - .. automethod:: unhook_zca - - .. automethod:: get_settings - - .. automethod:: commit - - .. automethod:: action - - .. automethod:: include - - .. automethod:: add_directive - - .. automethod:: with_package - - .. automethod:: maybe_dotted + .. automethod:: add_route - .. automethod:: absolute_asset_spec + .. automethod:: add_view - .. automethod:: setup_registry + .. automethod:: add_static_view(name, path, cache_max_age=3600, permission=NO_PERMISSION_REQUIRED) .. automethod:: add_renderer - .. automethod:: add_response_adapter - - .. automethod:: add_route + .. automethod:: add_subscriber - .. automethod:: add_static_view(name, path, cache_max_age=3600, permission=NO_PERMISSION_REQUIRED) + .. automethod:: add_response_adapter .. automethod:: add_settings - .. automethod:: add_subscriber - .. automethod:: add_translation_dirs - .. automethod:: add_view - .. automethod:: add_tween - .. automethod:: derive_view + .. automethod:: add_traverser + + .. automethod:: add_resource_url_adapter .. automethod:: make_wsgi_app() @@ -94,17 +65,45 @@ .. automethod:: set_notfound_view - .. automethod:: add_traverser - .. automethod:: set_renderer_globals_factory(factory) + .. automethod:: begin + + .. automethod:: end + + .. automethod:: hook_zca + + .. automethod:: unhook_zca + + .. automethod:: get_settings + + .. automethod:: commit + + .. automethod:: action + + .. automethod:: include + + .. automethod:: add_directive + + .. automethod:: with_package + + .. automethod:: maybe_dotted + + .. automethod:: absolute_asset_spec + + .. automethod:: setup_registry + + .. automethod:: derive_view + .. attribute:: introspectable A shortcut attribute which points to the :class:`pyramid.registry.Introspectable` class (used during directives to provide introspection to actions). - This attribute is new as of :app:`Pyramid` 1.3. + .. note:: + + This attribute is new as of :app:`Pyramid` 1.3. .. attribute:: introspector @@ -114,7 +113,14 @@ ``introspector`` argument, this attribute will be that value. Otherwise, it will be an instance of a default introspector type. - This attribute is new as of :app:`Pyramid` 1.3. + .. note:: + + This attribute is new as of :app:`Pyramid` 1.3. + + .. attribute:: registry + + The :term:`application registry` which holds the configuration + associated with this configurator. .. attribute:: global_registries -- cgit v1.2.3 From 66b20a9d467582064b91295dfd364118cc68a568 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 18 Feb 2012 10:12:17 -0500 Subject: categorized configurator methods --- docs/api/config.rst | 133 +++++++++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 65 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 87ba94673..b76fed9cb 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -1,99 +1,102 @@ .. _configuration_module: +.. role:: methodcategory + :class: methodcategory + :mod:`pyramid.config` --------------------- .. automodule:: pyramid.config - .. autoclass:: Configurator - - .. automethod:: add_route - - .. automethod:: add_view - - .. automethod:: add_static_view(name, path, cache_max_age=3600, permission=NO_PERMISSION_REQUIRED) - - .. automethod:: add_renderer - - .. automethod:: add_subscriber - - .. automethod:: add_response_adapter - - .. automethod:: add_settings +.. autoclass:: Configurator - .. automethod:: add_translation_dirs + :methodcategory:`Controlling Configuration State` - .. automethod:: add_tween + .. automethod:: commit + .. automethod:: begin + .. automethod:: end + .. automethod:: include + .. automethod:: make_wsgi_app() + .. automethod:: scan - .. automethod:: add_traverser + :methodcategory:`Adding Routes and Views` - .. automethod:: add_resource_url_adapter - - .. automethod:: make_wsgi_app() + .. automethod:: add_route + .. automethod:: add_static_view(name, path, cache_max_age=3600, permission=NO_PERMISSION_REQUIRED) + .. automethod:: add_view + .. automethod:: set_forbidden_view + .. automethod:: set_notfound_view - .. automethod:: override_asset(to_override, override_with) + :methodcategory:`Adding an Event Subscriber` - .. automethod:: scan + .. automethod:: add_subscriber - .. automethod:: set_locale_negotiator + :methodcategory:`Using Security` + .. automethod:: set_authentication_policy + .. automethod:: set_authorization_policy .. automethod:: set_default_permission - .. automethod:: set_session_factory - - .. automethod:: set_request_factory + :methodcategory:`Setting Request Properties` .. automethod:: set_request_property - .. automethod:: set_root_factory - - .. automethod:: set_view_mapper - - .. automethod:: set_authentication_policy - - .. automethod:: set_authorization_policy - - .. automethod:: testing_securitypolicy + :methodcategory:`Using I18N` - .. automethod:: testing_resources - - .. automethod:: testing_add_subscriber + .. automethod:: add_translation_dirs + .. automethod:: set_locale_negotiator - .. automethod:: testing_add_renderer + :methodcategory:`Overriding Assets` - .. automethod:: set_forbidden_view + .. automethod:: override_asset(to_override, override_with) - .. automethod:: set_notfound_view + :methodcategory:`Setting Renderer Globals` .. automethod:: set_renderer_globals_factory(factory) - .. automethod:: begin - - .. automethod:: end - - .. automethod:: hook_zca - - .. automethod:: unhook_zca + :methodcategory:`Getting and Adding Settings` + .. automethod:: add_settings .. automethod:: get_settings - .. automethod:: commit + :methodcategory:`Hooking Pyramid Behavior` - .. automethod:: action + .. automethod:: add_renderer + .. automethod:: add_resource_url_adapter + .. automethod:: add_response_adapter + .. automethod:: add_traverser + .. automethod:: add_tween + .. automethod:: set_request_factory + .. automethod:: set_root_factory + .. automethod:: set_session_factory + .. automethod:: set_view_mapper - .. automethod:: include + :methodcategory:`Extension Author APIs` + .. automethod:: action .. automethod:: add_directive - .. automethod:: with_package - .. automethod:: maybe_dotted + :methodcategory:`Utility Methods` .. automethod:: absolute_asset_spec - + .. automethod:: derive_view + .. automethod:: maybe_dotted .. automethod:: setup_registry - .. automethod:: derive_view + :methodcategory:`ZCA-Related APIs` + + .. automethod:: hook_zca + .. automethod:: unhook_zca + + :methodcategory:`Testing Helper APIs` + + .. automethod:: testing_add_renderer + .. automethod:: testing_add_subscriber + .. automethod:: testing_resources + .. automethod:: testing_securitypolicy + + :methodcategory:`Attributes` .. attribute:: introspectable @@ -122,15 +125,15 @@ The :term:`application registry` which holds the configuration associated with this configurator. - .. attribute:: global_registries +.. attribute:: global_registries - The set of registries that have been created for :app:`Pyramid` - applications, one per each call to - :meth:`pyramid.config.Configurator.make_wsgi_app` in the current - process. The object itself supports iteration and has a ``last`` - property containing the last registry loaded. + The set of registries that have been created for :app:`Pyramid` + applications, one per each call to + :meth:`pyramid.config.Configurator.make_wsgi_app` in the current + process. The object itself supports iteration and has a ``last`` property + containing the last registry loaded. - The registries contained in this object are stored as weakrefs, - thus they will only exist for the lifetime of the actual - applications for which they are being used. + The registries contained in this object are stored as weakrefs, thus they + will only exist for the lifetime of the actual applications for which they + are being used. -- cgit v1.2.3 From 65d4a671283f9162afd4c0f8a61009d1ac0b904f Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 20 Feb 2012 13:49:10 -0500 Subject: remove untruth --- docs/api/config.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index b76fed9cb..ca9351db0 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -112,9 +112,7 @@ The :term:`introspector` related to this configuration. It is an instance implementing the :class:`pyramid.interfaces.IIntrospector` - interface. If the Configurator constructor was supplied with an - ``introspector`` argument, this attribute will be that value. - Otherwise, it will be an instance of a default introspector type. + interface. .. note:: -- cgit v1.2.3 From 225a7b88ced6d2c4453a67b03d3c3592caf5141a Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 20 Feb 2012 13:53:22 -0500 Subject: recategorize a couple of methods --- docs/api/config.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index ca9351db0..6b4ed7b1b 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -76,18 +76,18 @@ .. automethod:: action .. automethod:: add_directive .. automethod:: with_package + .. automethod:: derive_view :methodcategory:`Utility Methods` .. automethod:: absolute_asset_spec - .. automethod:: derive_view .. automethod:: maybe_dotted - .. automethod:: setup_registry :methodcategory:`ZCA-Related APIs` .. automethod:: hook_zca .. automethod:: unhook_zca + .. automethod:: setup_registry :methodcategory:`Testing Helper APIs` -- cgit v1.2.3 From 0db4a157083d51251b4d3f574a1699fc76359c9d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 22 Feb 2012 15:37:50 -0500 Subject: - New API: ``pyramid.config.Configurator.add_notfound_view``. This is a wrapper for ``pyramid.Config.configurator.add_view`` which provides easy append_slash support. It should be preferred over calling ``add_view`` directly with ``context=HTTPNotFound`` as was previously recommended. - New API: ``pyramid.view.notfound_view_config``. This is a decorator constructor like ``pyramid.view.view_config`` that calls ``pyramid.config.Configurator.add_notfound_view`` when scanned. It should be preferred over using ``pyramid.view.view_config`` with ``context=HTTPNotFound`` as was previously recommended. - The older deprecated ``set_notfound_view`` Configurator method is now an alias for the new ``add_notfound_view`` Configurator method. This has the following impact: the ``context`` sent to views with a ``(context, request)`` call signature registered via the deprecated ``add_notfound_view``/``set_notfound_view`` will now be the HTTPNotFound exception object instead of the actual resource context found. Use ``request.context`` to get the actual resource context. It's also recommended to disuse ``set_notfound_view`` in favor of ``add_notfound_view``, despite the aliasing. - The API documentation for ``pyramid.view.append_slash_notfound_view`` and ``pyramid.view.AppendSlashNotFoundViewFactory`` was removed. These names still exist and are still importable, but they are no longer APIs. Use ``pyramid.config.Configurator.add_notfound_view(append_slash=True)`` or ``pyramid.view.notfound_view_config(append_slash=True)`` to get the same behavior. - The ``set_forbidden_view`` method of the Configurator was removed from the documentation. It has been deprecated since Pyramid 1.1. - The AppendSlashNotFoundViewFactory used request.path to match routes. This was wrong because request.path contains the script name, and this would cause it to fail in circumstances where the script name was not empty. It should have used request.path_info, and now does. - Updated the "Registering a Not Found View" section of the "Hooks" chapter, replacing explanations of registering a view using ``add_view`` or ``view_config`` with ones using ``add_notfound_view`` or ``notfound_view_config``. - Updated the "Redirecting to Slash-Appended Routes" section of the "URL Dispatch" chapter, replacing explanations of registering a view using ``add_view`` or ``view_config`` with ones using ``add_notfound_view`` or ``notfound_view_config`` --- docs/api/config.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 6b4ed7b1b..bf5fdbb7c 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -24,8 +24,7 @@ .. automethod:: add_route .. automethod:: add_static_view(name, path, cache_max_age=3600, permission=NO_PERMISSION_REQUIRED) .. automethod:: add_view - .. automethod:: set_forbidden_view - .. automethod:: set_notfound_view + .. automethod:: add_notfound_view :methodcategory:`Adding an Event Subscriber` -- cgit v1.2.3 From a7fe30f0eabd6c6fd3bcc910faa41720a75056de Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 22 Feb 2012 19:24:09 -0500 Subject: - New API: ``pyramid.config.Configurator.add_forbidden_view``. This is a wrapper for ``pyramid.Config.configurator.add_view`` which does the right thing about permissions. It should be preferred over calling ``add_view`` directly with ``context=HTTPForbidden`` as was previously recommended. - New API: ``pyramid.view.forbidden_view_config``. This is a decorator constructor like ``pyramid.view.view_config`` that calls ``pyramid.config.Configurator.add_forbidden_view`` when scanned. It should be preferred over using ``pyramid.view.view_config`` with ``context=HTTPForbidden`` as was previously recommended. - Updated the "Creating a Not Forbidden View" section of the "Hooks" chapter, replacing explanations of registering a view using ``add_view`` or ``view_config`` with ones using ``add_forbidden_view`` or ``forbidden_view_config``. - Updated all tutorials to use ``pyramid.view.forbidden_view_config`` rather than ``pyramid.view.view_config`` with an HTTPForbidden context. --- docs/api/config.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index bf5fdbb7c..cd58e74d3 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -25,6 +25,7 @@ .. automethod:: add_static_view(name, path, cache_max_age=3600, permission=NO_PERMISSION_REQUIRED) .. automethod:: add_view .. automethod:: add_notfound_view + .. automethod:: add_forbidden_view :methodcategory:`Adding an Event Subscriber` -- cgit v1.2.3 From 0196b2a06ef66d2e8b33a03cc84373ab84ba44be Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 6 Aug 2012 00:48:29 -0400 Subject: add docs for third-party view predicates --- docs/api/config.rst | 2 ++ 1 file changed, 2 insertions(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index cd58e74d3..bc9e067b1 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -66,6 +66,8 @@ .. automethod:: add_response_adapter .. automethod:: add_traverser .. automethod:: add_tween + .. automethod:: add_route_predicate + .. automethod:: add_view_predicate .. automethod:: set_request_factory .. automethod:: set_root_factory .. automethod:: set_session_factory -- cgit v1.2.3 From 6b180cbb77d6c5bee0e75220d93fc1800d1217df Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 15 Aug 2012 22:49:59 -0400 Subject: - An ``add_permission`` directive method was added to the Configurator. This directive registers a free-standing permission introspectable into the Pyramid introspection system. Frameworks built atop Pyramid can thus use the the ``permissions`` introspectable category data to build a comprehensive list of permissions supported by a running system. Before this method was added, permissions were already registered in this introspectable category as a side effect of naming them in an ``add_view`` call, this method just makes it possible to arrange for a permission to be put into the ``permissions`` introspectable category without naming it along with an associated view. Here's an example of usage of ``add_permission``:: config = Configurator() config.add_permission('view') --- docs/api/config.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index bc9e067b1..1b887988a 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -36,6 +36,7 @@ .. automethod:: set_authentication_policy .. automethod:: set_authorization_policy .. automethod:: set_default_permission + .. automethod:: add_permission :methodcategory:`Setting Request Properties` -- cgit v1.2.3 From 2c25342383eed7b10e349b2396eed08d332cfb80 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Thu, 16 Aug 2012 02:28:43 -0500 Subject: docs-deprecated set_request_property --- docs/api/config.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 1b887988a..8dbe6de91 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -38,9 +38,9 @@ .. automethod:: set_default_permission .. automethod:: add_permission - :methodcategory:`Setting Request Properties` + :methodcategory:`Extending the Request Object` - .. automethod:: set_request_property + .. automethod:: set_request_method :methodcategory:`Using I18N` -- cgit v1.2.3 From 9cdb28614e558a886cb75d1d9ce9689621199722 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 16 Aug 2012 11:25:23 -0400 Subject: readd set_request_property to docs (just so when people run across it in in-the-wild code they're not totally confused); we'll remove it later --- docs/api/config.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 8dbe6de91..028a55d4b 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -41,6 +41,7 @@ :methodcategory:`Extending the Request Object` .. automethod:: set_request_method + .. automethod:: set_request_property :methodcategory:`Using I18N` -- cgit v1.2.3 From 023c88b67b907dd3682ef71216245609c9bbdbe1 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 9 Sep 2012 23:01:06 -0400 Subject: rename set_request_method to add_request_method. closes #683 --- docs/api/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 028a55d4b..5d2bce23e 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -40,7 +40,7 @@ :methodcategory:`Extending the Request Object` - .. automethod:: set_request_method + .. automethod:: add_request_method .. automethod:: set_request_property :methodcategory:`Using I18N` -- cgit v1.2.3 From fa1ac6744f1e2308190ba84dd60d573b4fa25fb3 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Tue, 15 Jan 2013 00:56:42 +0200 Subject: another grammar fix --- docs/api/config.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 5d2bce23e..e6a67830e 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -130,7 +130,7 @@ .. attribute:: global_registries The set of registries that have been created for :app:`Pyramid` - applications, one per each call to + applications, one for each call to :meth:`pyramid.config.Configurator.make_wsgi_app` in the current process. The object itself supports iteration and has a ``last`` property containing the last registry loaded. -- cgit v1.2.3 From 0b23b34cf7f759d7f2895696b8ec07c3a4d1e80a Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 23 Jan 2013 01:43:48 +0200 Subject: pyramid.config: take advantage of some Sphinx directives * versionadded * versionchanged * deprecated --- docs/api/config.rst | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index e6a67830e..39d504348 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -108,9 +108,7 @@ :class:`pyramid.registry.Introspectable` class (used during directives to provide introspection to actions). - .. note:: - - This attribute is new as of :app:`Pyramid` 1.3. + .. versionadded:: 1.3 .. attribute:: introspector @@ -118,9 +116,7 @@ instance implementing the :class:`pyramid.interfaces.IIntrospector` interface. - .. note:: - - This attribute is new as of :app:`Pyramid` 1.3. + .. versionadded:: 1.3 .. attribute:: registry -- cgit v1.2.3 From 32333e4d84fe0e71ce097a5dca57025353956dbe Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 24 Jul 2013 17:22:48 -0400 Subject: add not_ predicate feature --- docs/api/config.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 39d504348..1f65be9f1 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -135,3 +135,4 @@ will only exist for the lifetime of the actual applications for which they are being used. +.. autoclass:: not_ -- cgit v1.2.3 From c6601f77f91dc933ca429d1448f4c6b27857b608 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 8 Sep 2013 22:52:54 -0400 Subject: - The ``renderer_globals_factory`` argument to the ``pyramid.config.Configurator` constructor and its ``setup_registry`` method has been removed. The ``set_renderer_globals_factory`` method of ``pyramid.config.Configurator`` has also been removed. The (internal) ``pyramid.interfaces.IRendererGlobals`` interface was also removed. These arguments, methods and interfaces had been deprecated since 1.1. Use a ``BeforeRender`` event subscriber as documented in the "Hooks" chapter of the Pyramid narrative documentation instead of providing renderer globals values to the configurator. --- docs/api/config.rst | 4 ---- 1 file changed, 4 deletions(-) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 1f65be9f1..48dd2f0b9 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -52,10 +52,6 @@ .. automethod:: override_asset(to_override, override_with) - :methodcategory:`Setting Renderer Globals` - - .. automethod:: set_renderer_globals_factory(factory) - :methodcategory:`Getting and Adding Settings` .. automethod:: add_settings -- cgit v1.2.3 From 568a025d3156ee1e7bdf92e14c9eba7390c1dd26 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Tue, 17 Feb 2015 18:58:53 -0600 Subject: expose public config phases in pyramid.config --- docs/api/config.rst | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index 48dd2f0b9..ae913d32c 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -132,3 +132,8 @@ are being used. .. autoclass:: not_ + +.. attribute:: PHASE0_CONFIG +.. attribute:: PHASE1_CONFIG +.. attribute:: PHASE2_CONFIG +.. attribute:: PHASE3_CONFIG -- cgit v1.2.3 From 35e632635b1b4e0a767024689d69d9469ae98c0f Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Mon, 14 Mar 2016 23:28:15 -0500 Subject: add a docstring for add_view_deriver and expose the method to the api docs --- docs/api/config.rst | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/api/config.rst') diff --git a/docs/api/config.rst b/docs/api/config.rst index ae913d32c..e083dbc68 100644 --- a/docs/api/config.rst +++ b/docs/api/config.rst @@ -66,6 +66,7 @@ .. automethod:: add_tween .. automethod:: add_route_predicate .. automethod:: add_view_predicate + .. automethod:: add_view_deriver .. automethod:: set_request_factory .. automethod:: set_root_factory .. automethod:: set_session_factory -- cgit v1.2.3