summaryrefslogtreecommitdiff
path: root/docs/narr
AgeCommit message (Collapse)Author
2009-11-23Documentation improvements.Chris McDonough
2009-11-23- The ``repoze.bfg.router.make_app`` function is now nominallyChris McDonough
deprecated. Its import and usage does not throw a warning, nor will it probably ever disappear. However, using a ``repoze.bfg.configuration.Configurator`` class is now the preferred way to generate a WSGI application. - The ``run.py`` module in various ``repoze.bfg`` ``paster`` templates now use a ``repoze.bfg.configuration.Configurator`` class instead of the (now-legacy) ``repoze.bfg.router.make_app`` function to produce a WSGI application.
2009-11-22Renderings.Chris McDonough
2009-11-22Rendering.Chris McDonough
2009-11-22Rendering tweaks.Chris McDonough
2009-11-22some suggestions for alternative wording on the introduction. The second and ↵Carlos de la Guardia
third paragraphs were very redundant.
2009-11-22Docs tweaks.Chris McDonough
2009-11-22Test load_zcml.Chris McDonough
2009-11-22Murg 2.Chris McDonough
2009-11-22Murg.Chris McDonough
2009-11-21Typo.Chris McDonough
2009-11-21Use a sidebar.Chris McDonough
2009-11-21Beginnings of explaining configuration modes.Chris McDonough
2009-11-19Fix links.Chris McDonough
2009-11-14Spellcheck.Chris McDonough
2009-11-14- Improve the "Extending an Existing Application" narrative chapter.Chris McDonough
2009-11-13Untrue.Chris McDonough
2009-11-11Remove space.Chris McDonough
2009-11-11Fix arg ordering.Chris McDonough
2009-11-10More setup and teardown.Chris McDonough
2009-11-10TemplatesChris McDonough
--------- - Remove ``ez_setup.py`` and its import from all paster templates, samples, and tutorials for ``distribute`` compatibility. The documentation already explains how to install virtualenv (which will include some ``setuptools`` package), so these files, imports and usages were superfluous. Deprecations ------------ - The ``options`` kw arg to the ``repoze.bfg.router.make_app`` function is deprecated. In its place is the keyword argument ``settings``. The ``options`` keyword continues to work, and a deprecation warning is not emitted when it is detected. However, the paster templates, code samples, and documentation now make reference to ``settings`` rather than ``options``. This change/deprecation was mainly made for purposes of clarity and symmetry with the ``get_settings()`` API and dicussions of "settings" in various places in the docs: we want to use the same name to refer to the same thing everywhere.
2009-11-06Update slightly.Chris McDonough
2009-11-02New nosetests output status.Chris McDonough
2009-11-02- "What's New in ``repoze.bfg`` 1.1" document added to narrativeChris McDonough
documentation. - Minor typo fixes.
2009-11-01Remove incorrect docs from hybrid chapter.Chris McDonough
Organize changelog of 1.1a1 into categories.
2009-11-01Leave some confusing and near-useless params undocumented.Chris McDonough
2009-11-01- The ZCML ``route`` directive's attributes ``xhr``,Chris McDonough
``request_method``, ``path_info``, ``request_param``, ``header`` and ``accept`` are now *route* predicates rather than *view* predicates. If one or more of these predicates is specified in the route configuration, all of the predicates must return true for the route to match a request. If one or more of the route predicates associated with a route returns ``False`` when checked during a request, the route match fails, and the next match in the routelist is tried. This differs from the previous behavior, where no route predicates existed and all predicates were considered view predicates, because in that scenario, the next route was not tried.
2009-10-30- The ``__call__`` of a plugin "traverser" implementation (registeredChris McDonough
as an adapter for ``ITraverser`` or ``ITraverserFactory``) will now receive a *request* as the single argument to its ``__call__`` method. In previous versions it was passed a WSGI ``environ`` object. The request object passed to the factory implements dictionary-like methods in such a way that existing traverser code which expects to be passed an environ will continue to work. - Fix docs.
2009-10-26Revert 6873, as it introduces an unnecessary providedBy for each request in ↵Chris McDonough
the 99% case, and its behavior can be emulated by returning a root object that implements some interface and registering a traverser for that interface.
2009-10-26The root factory may now return an object which implements ``ITraverser`` ↵Malthe Borch
directly. In this case, no adaptation is done before traversal. This feature is added such that a routes factory can implement its own traversal logic without establishing an artificial context only to get a hook into the traversal machinery.
2009-10-26Adapt to ``ITraverser`` instead of ``ITraverserFactory``. While this change ↵Malthe Borch
breaks backwards compatibility, migration is trivial.
2009-10-23- Added ``max_age`` parameter to ``authtktauthenticationpolicy`` ZCMLChris McDonough
directive. If this value is set, it must be an integer representing the number of seconds which the auth tkt cookie will survive. Mainly, its existence allows the auth_tkt cookie to survive across browser sessions. - The ``reissue_time`` argument to the ``authtktauthenticationpolicy`` ZCML directive now actually works. When it is set to an integer value, an authticket set-cookie header is appended to the response whenever a request requires authentication and 'now' minus the authticket's timestamp is greater than ``reissue_time`` seconds. - The router now checks for a ``global_response_headers`` attribute of the request object before returning a response. If this value exists, it is presumed to be a sequence of two-tuples, representing a set of headers to append to the 'normal' response headers. This feature is internal, rather than exposed internally, because it's unclear whether it will stay around in the long term. It was added to support the ``reissue_time`` feature of the authtkt authentication policy. - The ``authtkt`` authentication policy ``remember`` method now no longer honors ``token`` or ``userdata`` keyword arguments.
2009-10-22(no commit message)Chris McDonough
2009-10-22It's an envvar.Chris McDonough
2009-10-22Added ``path_info`` predicate (regex-filters on the corresponding HTTP header).Malthe Borch
2009-10-19- ``paster bfgshell`` now supports IPython if it's available forChris McDonough
import. Thanks to Daniel Holth for the initial patch.
2009-10-19Refer to webob chapter in glossary.Chris McDonough
2009-10-19Better disambiguation of predicate vs. non-predicate attributes.Chris McDonough
2009-10-19- Call out predicate attributes of ZCML directive within "Views"Chris McDonough
chapter.
2009-10-19- Add a chapter titled "Request and Response" to the narrativeChris McDonough
documentation, content cribbed from the WebOb documentation.
2009-10-18Add filesystem analogy.Chris McDonough
2009-10-18Renderings.Chris McDonough
2009-10-18- Added ``Changing the Traverser`` and ``Changing HowChris McDonough
:mod:`repoze.bfg.url.model_url` Generates a URL`` to the "Hooks" narrative chapter of the docs.
2009-10-18- The ``@bfg_view`` decorator can now be used against a class method::Chris McDonough
from webob import Response from repoze.bfg.view import bfg_view class MyView(object): def __init__(self, context, request): self.context = context self.request = request @bfg_view(name='hello') def amethod(self): return Response('hello from %s!' % self.context) When the bfg_view decorator is used against a class method, a view is registered for the *class* (it's a "class view" where the "attr" happens to be the method they're attached to), so the view class must have a suitable constructor.
2009-10-18- More than one ``@bfg_view`` decorator may now be stacked on top ofChris McDonough
any number of others. Each invocation of the decorator registers a single view. For instance, the following combination of decorators and a function will register two views:: from repoze.bfg.view import bfg_view @bfg_view(name='edit') @bfg_view(name='change') def edit(context, request): pass This makes it possible to associate more than one view configuration for a single callable without requiring ZCML.
2009-10-17Moar.Chris McDonough
2009-10-17Be more explicit.Chris McDonough
2009-10-16- Add ``zcml_configure`` to ``repoze.bfg.testing`` module API. ThisChris McDonough
function populates a component registry from a ZCML file for testing purposes.
2009-10-16- Added "Creating Integration Tests" section to unit testing narrativeChris McDonough
documentation chapter.
2009-10-15FeaturesChris McDonough
-------- - Add ``setUp`` and ``tearDown`` functions to the ``repoze.bfg.testing`` module. Using ``setUp`` in a test setup and ``tearDown`` in a test teardown is now the recommended way to do component registry setup and teardown. Previously, it was recommended that a single function named ``repoze.bfg.testing.cleanUp`` be called in both the test setup and tear down. ``repoze.bfg.testing.cleanUp`` still exists (and will exist "forever" due to its widespread use); it is now just an alias for ``repoze.bfg.testing.setUp`` and is nominally deprecated. - The BFG component registry is now available in view and event subscriber code as an attribute of the request ie. ``request.registry``. This fact is currently undocumented except for this note, because BFG developers never need to interact with the registry directly anywhere else. - The BFG component registry now inherits from ``dict``, meaning that it can optionally be used as a simple dictionary. *Component* registrations performed against it via e.g. ``registerUtility``, ``registerAdapter``, and similar API methods are kept in a completely separate namespace than its dict members, so using the its component API methods won't effect the keys and values in the dictionary namespace. Likewise, though the component registry "happens to be" a dictionary, use of mutating dictionary methods such as ``__setitem__`` will have no influence on any component registrations made against it. In other words, the registry object you obtain via e.g. ``repoze.bfg.threadlocal.get_current_registry`` or ``request.registry`` happens to be both a component registry and a dictionary, but using its component-registry API won't impact data added to it via its dictionary API and vice versa. This is a forward compatibility move based on the goals of "marco". Documentation ------------- - Various tutorial test modules updated to use ``repoze.bfg.testing.setUp`` and ``repoze.bfg.testing.tearDown`` methods in order to encourage this as best practice going forward. Backwards Incompatibilities --------------------------- - Importing ``getSiteManager`` and ``get_registry`` from ``repoze.bfg.registry`` is no longer supported. These imports were deprecated in repoze.bfg 1.0. Import of ``getSiteManager`` should be done as ``from zope.component import getSiteManager``. Import of ``get_registry`` should be done as ``from repoze.bfg.threadlocal import get_current_registry``. This was done to prevent a circular import dependency. - Code bases which alternately invoke both ``zope.testing.cleanup.cleanUp`` and ``repoze.bfg.testing.cleanUp`` (treating them equivalently, using them interchangeably) in the setUp/tearDown of unit tests will begin to experience test failures due to lack of test isolation. The "right" mechanism is ``repoze.bfg.testing.cleanUp`` (or the combination of ``repoze.bfg.testing.setUp`` and ``repoze.bfg.testing.tearDown``). but a good number of legacy codebases will use ``zope.testing.cleanup.cleanUp`` instead. We support ``zope.testing.cleanup.cleanUp`` but not in combination with ``repoze.bfg.testing.cleanUp`` in the same codebase. You should use one or the other test cleanup function in a single codebase, but not both. Internal -------- - Created new ``repoze.bfg.configuration`` module which assumes responsibilities previously held by the ``repoze.bfg.registry`` and ``repoze.bfg.router`` modules (avoid a circular import dependency). - The result of the ``zope.component.getSiteManager`` function in unit tests set up with ``repoze.bfg.testing.cleanUp`` or ``repoze.bfg.testing.setUp`` will be an instance of ``repoze.bfg.registry.Registry`` instead of the global ``zope.component.globalregistry.base`` registry. This also means that the threadlocal ZCA API functions such as ``getAdapter`` and ``getUtility`` as well as internal BFG machinery (such as ``model_url`` and ``route_url``) will consult this registry within unit tests. This is a forward compatibility move based on the goals of "marco". - Removed ``repoze.bfg.testing.addCleanUp`` function and associated module-scope globals. This was never an API.