summaryrefslogtreecommitdiff
path: root/docs/api/configuration.rst
AgeCommit message (Collapse)Author
2010-12-09fix docs: pyramid.configuration -> pyramid.configChris McDonough
2010-10-28add sessioning interfaces, configuration API, and a sample implementation ↵Chris McDonough
that uses cookies
2010-10-28merge static view bugfixes/features from bfg trunkChris McDonough
2010-10-26add handler codeChris McDonough
2010-10-25convert API docs to PyramidChris McDonough
2010-09-09FeaturesChris McDonough
-------- - In support of making it easier to configure applications which are "secure by default", a default permission feature was added. If supplied, the default permission is used as the permission string to all view registrations which don't otherwise name a permission. These APIs are in support of that: - A new constructor argument was added to the Configurator: ``default_permission``. - A new method was added to the Configurator: ``set_default_permission``. - A new ZCML directive was added: ``default_permission``. Documentation ------------- - Added documentation for the ``default_permission`` ZCML directive. - Added documentation for the ``default_permission`` constructor value and the ``set_default_permission`` method in the Configurator API documentation. - Added a new section to the "security" chapter named "Setting a Default Permission". - Document ``renderer_globals_factory`` and ``request_factory`` arguments to Configurator constructor.
2010-08-13- The newChris McDonough
:meth"`repoze.bfg.configuration.Configurator.absolute_resource_spec` method resolves a potentially relative :term:`resource specification` string into an absolute version.
2010-08-13- The Configurator now accepts a dotted name *string* to a package asChris McDonough
a ``package`` constructor argument. The ``package`` argument was previously required to be a package *object* (not a dotted name string). - The ``repoze.bfg.configuration.Configurator.with_package`` method was added. This method returns a new Configurator using the same application registry as the configurator object it is called upon. The new configurator is created afresh with its ``package`` constructor argument set to the value passed to ``with_package``. This feature will make it easier for future BFG versions to allow dotted names as arguments in places where currently only object references are allowed (the work to allow dotted names isntead of object references everywhere has not yet been done, however). - The ``repoze.bfg.configuration.Configurator.maybe_dotted`` method resolves a Python dotted name string supplied as its ``dotted`` argument to a global Python object. If the value cannot be resolved, a ``repoze.bfg.configuration.ConfigurationError`` is raised. If the value supplied as ``dotted`` is not a string, the value is returned unconditionally without any resolution attempted.
2010-07-26merge generic_rendering branchChris McDonough
2010-07-24add set_request_factoryChris McDonough
2010-04-25- Add a new method of the Configurator named ``derive_view`` which canChris McDonough
be used to generate a BFG view callable from a user-supplied function, instance, or class. This useful for external framework and plugin authors wishing to wrap callables supplied by their users which follow the same calling conventions and response conventions as objects that can be supplied directly to BFG as a view callable. See the ``derive_view`` method in the ``repoze.bfg.configuration.Configurator`` docs.
2010-04-25Merge i18n branch via svn merge --ignore-ancestry -r9030:9150 ↵Chris McDonough
$REPOZE_SVN/repoze.bfg/branches/i18n No foreigners were harmed in the coding of this feature.
2010-04-18- Use "Venusian" (`http://docs.repoze.org/venusianChris McDonough
<http://docs.repoze.org/venusian>`) to perform ``bfg_view`` decorator scanning rather than relying on a BFG-internal decorator scanner. (Truth be told, Venusian is really just a generalization of the BFG-internal decorator scanner). - A new install-time dependency on the ``venusian`` distribution was added. - Remove ``repoze.bfg.compat.pkgutil_26.py`` and import alias ``repoze.bfg.compat.walk_packages``. These were only required by internal scanning machinery; Venusian replaced the internal scanning machinery, so these are no longer required.
2009-12-24- Document the previously existing (but non-API)Chris McDonough
``repoze.bfg.configuration.Configurator.setup_registry`` method as an official API of a ``Configurator``.
2009-12-23- Add ``hook_zca`` and ``unhook_zca`` methods to the ``Configurator``Chris McDonough
API. - Add roles to configurator API docs.
2009-12-20Document presence of the registry attribute.Chris McDonough
2009-12-20Get rid of add_adapter and add_utility APIs (config.registry.registerAdapter ↵Chris McDonough
and config.registry.registerUtility will work).
2009-12-19- Add four new testing-related APIs to theChris McDonough
``repoze.bfg.configuration.Configurator`` class: ``testing_securitypolicy``, ``testing_models``, ``testing_add_subscriber``, and ``testing_add_template``. These were added in order to provide more direct access to the functionality of the ``repoze.bfg.testing`` APIs named ``registerDummySecurityPolicy``, ``registerModels``, ``registerEventListener``, and ``registerTemplateRenderer`` when a configurator is used. The ``testing`` APIs named are nominally deprecated (although they will likely remain around "forever", as they are in heavy use in the wild). - Doc-deprecated most helper functions in the ``repoze.bfg.testing`` module. These helper functions likely won't be removed any time soon, nor will they generate a warning any time soon, due to their heavy use in the wild, but equivalent behavior exists in methods of a Configurator.
2009-12-19- Add a new API to the ``repoze.bfg.configuration.Configurator``Chris McDonough
class: ``add_settings``. This API can be used to add "settings" (information returned within via the ``repoze.bfg.settings.get_settings`` API) after the configurator has been initially set up. This is most useful for testing purposes.
2009-12-19- Add two new APIs to the ``repoze.bfg.configuration.Configurator``Chris McDonough
class: ``add_adapter`` and ``add_utility``. These, respectively, perform the same functions as the ``registerAdapter`` and ``registerUtility`` functions of a ZCA registry. They were added to allow for a more consistent testing API for applications that make use of the ZCA directly. - Cause the ``adapter``, ``utility``, and ``subscriber`` ZCML directives to use a ``Configurator`` instance and associated configurator APIs rather than a ZCA registry directly.
2009-12-17FeaturesChris McDonough
-------- - The ``Configurator`` object now has two new methods: ``begin`` and ``end``. The ``begin`` method is meant to be called before any "configuration" begins (e.g. before ``add_view``, et. al are called). The ``end`` method is meant to be called after all "configuration" is complete. Previously, before there was imperative configuration at all (1.1 and prior), configuration begin and end was invariably implied by the process of loading a ZCML file. When a ZCML load happened, the threadlocal data structure containing the request and registry was modified before the load, and torn down after the load, making sure that all framework code that needed ``get_current_registry`` for the duration of the ZCML load was satisfied. Some API methods called during imperative configuration, (such as ``Configurator.add_view`` when a renderer is involved) end up for historical reasons calling ``get_current_registry``. However, in 1.2a5 and below, the Configurator supplied no functionality that allowed people to make sure that ``get_current_registry`` returned the registry implied by the configurator being used. ``begin`` now serves this purpose. Inversely, ``end`` pops the thread local stack, undoing the actions of ``begin``. We make this boundary explicit to reduce the potential for confusion when the configurator is used in different circumstances (e.g. in unit tests and app code vs. just in initial app setup). Existing code written for 1.2a1-1.2a5 which does not call ``begin`` or ``end`` continues to work in the same manner it did before. It is however suggested that this code be changed to call ``begin`` and ``end`` to reduce the potential for confusion in the future. - All ``paster`` templates which generate an application skeleton now make use of the new ``begin`` and ``end`` methods of the Configurator they use in their respective copies of ``run.py`` and ``tests.py``. Documentation ------------- - All documentation that makes use of a ``Configurator`` object to do application setup and test setup now makes use of the new ``begin`` and ``end`` methods of the configurator. Bug Fixes --------- - When a ``repoze.bfg.exceptions.NotFound`` or ``repoze.bfg.exceptions.Forbidden`` *class* (as opposed to instance) was raised as an exception within a root factory (or route root factory), the exception would not be caught properly by the ``repoze.bfg.`` Router and it would propagate to up the call stack, as opposed to rendering the not found view or the forbidden view as would have been expected.
2009-11-27Coverage.Chris McDonough
Remove set_security_policies configurator API method.
2009-11-27- The ``repoze.bfg.testing.setUp`` function now accepts three extraChris McDonough
optional keyword arguments: ``registry``, ``request`` and ``hook_zca``. If the ``registry`` argument is not ``None``, the argument will be treated as the registry that is set as the "current registry" (it will be returned by ``repoze.bfg.threadlocal.get_current_registry``) for the duration of the test. If the ``registry`` argument is ``None`` (the default), a new registry is created and used for the duration of the test. The value of the ``request`` argument is used as the "current request" (it will be returned by ``repoze.bfg.threadlocal.get_current_request``) for the duration of the test; it defaults to ``None``. If ``hook_zca`` is ``True`` (the default), the ``zope.component.getSiteManager`` function will be hooked with a function that returns the value of ``registry`` (or the default-created registry if ``registry`` is ``None``) instead of the registry returned by ``zope.component.getGlobalSiteManager``, causing the Zope Component Architecture API (``getSiteManager``, ``getAdapter``, ``getUtility``, and so on) to use the registry we're using for testing instead of the global ZCA registry. - The ``repoze.bfg.testing.tearDown`` function now accepts an ``unhook_zca`` argument. If this argument is ``True`` (the default), ``zope.component.getSiteManager.reset()`` will be called, causing the "base" registry to once again start returnining the result of ``zope.component.getSiteManager``. - Remove hook_zca and unhook_zca methods from Configurator.
2009-11-27Get rid of ``zcml_file`` argument in configurator constructor in favor of ↵Chris McDonough
the load_zcml API. Get rid of hook_zca argument in configurator constructor in favor of a ``hook_zca`` method. Provide an ``unhook_zca`` method.
2009-11-24Make hooking getSiteManager optional.Chris McDonough
2009-11-24Docs updates.Chris McDonough
2009-11-23- The ``repoze.bfg.interfaces.ITemplateRendererFactory`` interface wasChris McDonough
removed; it has become unused. - Change imperative API.
2009-11-23Avoid stupidness.Chris McDonough
2009-11-23Change the API.Chris McDonough
2009-11-21Add meager API docs for Configurator.Chris McDonough