summaryrefslogtreecommitdiff
path: root/repoze/bfg/includes
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-01-27 21:57:11 +0000
committerChris McDonough <chrism@agendaless.com>2009-01-27 21:57:11 +0000
commite62e479e338e428f6cfd3b07790545982b7cb94f (patch)
treec9784577f791d4a8ea5b80a9fce211ce86009712 /repoze/bfg/includes
parent2301cf61977102b85279ea7c04797f76012202e5 (diff)
downloadpyramid-e62e479e338e428f6cfd3b07790545982b7cb94f.tar.gz
pyramid-e62e479e338e428f6cfd3b07790545982b7cb94f.tar.bz2
pyramid-e62e479e338e428f6cfd3b07790545982b7cb94f.zip
Features
-------- - The ``repoze.bfg.url.model_url`` API now works against contexts derived from Routes URL dispatch (``Routes.util.url_for`` is called under the hood). - "Virtual root" support for traversal-based applications has been added. Virtual root support is useful when you'd like to host some model in a :mod:`repoze.bfg` model graph as an application under a URL pathname that does not include the model path itself. For more information, see the (new) "Virtual Hosting" chapter in the documentation. - A ``repoze.bfg.traversal.virtual_root`` API has been added. When called, it returns the virtual root object (or the physical root object if no virtual root has been specified). Implementation Changes ---------------------- - ``repoze.bfg.traversal.RoutesModelTraverser`` has been moved to ``repoze.bfg.urldispatch``. - ``model_url`` URL generation is now performed via an adapter lookup based on the context and the request. - ZCML which registers two adapters for the ``IContextURL`` interface has been added to the configure.zcml in ``repoze.bfg.includes``.
Diffstat (limited to 'repoze/bfg/includes')
-rw-r--r--repoze/bfg/includes/configure.zcml18
1 files changed, 17 insertions, 1 deletions
diff --git a/repoze/bfg/includes/configure.zcml b/repoze/bfg/includes/configure.zcml
index 07f8ab3fa..7a07e1775 100644
--- a/repoze/bfg/includes/configure.zcml
+++ b/repoze/bfg/includes/configure.zcml
@@ -4,6 +4,8 @@
<include package="chameleon.zpt" file="configure.zcml"/>
+ <!-- traversal adapters -->
+
<adapter
factory="repoze.bfg.traversal.ModelGraphTraverser"
provides="repoze.bfg.interfaces.ITraverserFactory"
@@ -11,11 +13,25 @@
/>
<adapter
- factory="repoze.bfg.traversal.RoutesModelTraverser"
+ factory="repoze.bfg.traversal.TraversalContextURL"
+ provides="repoze.bfg.interfaces.IContextURL"
+ for="*"
+ />
+
+ <!-- URL dispatch adapters -->
+
+ <adapter
+ factory="repoze.bfg.urldispatch.RoutesModelTraverser"
provides="repoze.bfg.interfaces.ITraverserFactory"
for="repoze.bfg.interfaces.IRoutesContext"
/>
+ <adapter
+ factory="repoze.bfg.urldispatch.RoutesContextURL"
+ provides="repoze.bfg.interfaces.IContextURL"
+ for="repoze.bfg.interfaces.IRoutesContext"
+ />
+
<include file="meta.zcml" />
</configure>