From b606d97195187bdb33e334a7a40df501b30e2f48 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 19 Jun 2009 09:24:49 +0000 Subject: - A new ZCML directive was added named ``notfound``. This ZCML directive can be used to name a view that should be invoked when the request can't otherwise be resolved to a view callable. For example:: - A new ZCML directive was added named ``forbidden``. This ZCML directive can be used to name a view that should be invoked when a view callable for a request is found, but cannot be invoked due to an authorization failure. For example:: --- CHANGES.txt | 31 +++++++++++++++++++++ repoze/bfg/includes/meta.zcml | 12 +++++++++ repoze/bfg/router.py | 6 ++--- repoze/bfg/tests/test_router.py | 2 +- repoze/bfg/tests/test_zcml.py | 60 +++++++++++++++++++++++++++++++++++++++-- repoze/bfg/zcml.py | 30 +++++++++++++++++++++ 6 files changed, 135 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 476048dc5..43ea07b32 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,21 @@ Next release Features -------- +- A new ZCML directive was added named ``notfound``. This ZCML + directive can be used to name a view that should be invoked when the + request can't otherwise be resolved to a view callable. For example:: + + + +- A new ZCML directive was added named ``forbidden``. This ZCML + directive can be used to name a view that should be invoked when a + view callable for a request is found, but cannot be invoked due to + an authorization failure. For example:: + + + - Allow views to be *optionally* defined as callables that accept only a request object, instead of both a context and a request (which still works, and always will). The following types work as views in @@ -81,6 +96,19 @@ Features contain a key ``bfg.routes.route`` (the Route object which matched), and a key ``bfg.routes.matchdict`` (the result of calling route.match). +Deprecations +------------ + +- Utility registrations against + ``repoze.bfg.interfaces.INotFoundView`` and + ``repoze.bfg.interfaces.IForbiddenView`` are now deprecated. Use + the ``notfound`` and ``forbidden`` ZCML directives instead (see the + "Hooks" chapter for more information). Such registrations will + continue to work, but the notfound and forbidden directives do + "extra work" to ensure that the callable named by the directive can + be called by the router even if it's a class or + request-argument-only view. + Removals -------- @@ -136,6 +164,9 @@ Bug Fixes Documentation ------------- +- A "router" chapter explaining the request/response lifecycle at a + high level was added. + - Replaced all mentions and explanations of a routes "context factory" with equivalent explanations of a "root factory" (context factories have been disused). diff --git a/repoze/bfg/includes/meta.zcml b/repoze/bfg/includes/meta.zcml index 83fb48e87..36129c5e3 100644 --- a/repoze/bfg/includes/meta.zcml +++ b/repoze/bfg/includes/meta.zcml @@ -16,6 +16,18 @@ handler="repoze.bfg.zcml.scan" /> + + + +