summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-11-21 05:07:44 +0000
committerChris McDonough <chrism@agendaless.com>2009-11-21 05:07:44 +0000
commit687debd118c601a261cd0a32905c5f5a18515c5c (patch)
treed695bcbbcc1530ec40cc29ca6e96a5573d4fe451
parent2a264f946dd98ab423b458ba8e2c1ec3b55052e1 (diff)
downloadpyramid-687debd118c601a261cd0a32905c5f5a18515c5c.tar.gz
pyramid-687debd118c601a261cd0a32905c5f5a18515c5c.tar.bz2
pyramid-687debd118c601a261cd0a32905c5f5a18515c5c.zip
- "Hybrid mode" applications (applications which explicitly used
traversal *after* url dispatch via ``<route>`` paths containing the ``*traverse`` element) were broken in 1.1-final and all 1.1 alpha and beta releases. Views registered without a ``route_name`` route shadowed views registered with a ``route_name`` inappropriately.
-rw-r--r--repoze/bfg/interfaces.py6
-rw-r--r--repoze/bfg/request.py4
-rw-r--r--repoze/bfg/tests/test_request.py4
3 files changed, 4 insertions, 10 deletions
diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py
index 582e8984d..d7963ef22 100644
--- a/repoze/bfg/interfaces.py
+++ b/repoze/bfg/interfaces.py
@@ -6,9 +6,9 @@ from zope.component.interfaces import IObjectEvent
class IRequest(Interface):
""" Request type interface attached to all request objects """
-class IRouteRequest(IRequest):
- """ *internal only* interface used to mark a request when a route
- matches. Not an API."""
+class IRouteRequest(Interface):
+ """ *internal only* interface used as in a utility lookup to find
+ route-specific interfaces. Not an API."""
class IResponseFactory(Interface):
""" A utility which generates a response factory """
diff --git a/repoze/bfg/request.py b/repoze/bfg/request.py
index 07151b512..d25e93ef0 100644
--- a/repoze/bfg/request.py
+++ b/repoze/bfg/request.py
@@ -1,12 +1,10 @@
from zope.deprecation import deprecated
from zope.interface import implements
from zope.interface.interface import InterfaceClass
-from zope.interface.interface import Interface
from webob import Request as WebobRequest
from repoze.bfg.interfaces import IRequest
-from repoze.bfg.interfaces import IRouteRequest
def make_request_ascii(event):
""" An event handler that causes the request charset to be ASCII;
@@ -80,7 +78,7 @@ class Request(WebobRequest):
return self.environ.values()
def route_request_iface(name):
- return InterfaceClass('%s_IRequest' % name, (IRouteRequest,))
+ return InterfaceClass('%s_IRequest' % name)
def add_global_response_headers(request, headerlist):
attrs = request.__dict__
diff --git a/repoze/bfg/tests/test_request.py b/repoze/bfg/tests/test_request.py
index 7d9e956ae..a10ba1a75 100644
--- a/repoze/bfg/tests/test_request.py
+++ b/repoze/bfg/tests/test_request.py
@@ -150,11 +150,7 @@ class Test_route_request_iface(unittest.TestCase):
return route_request_iface(name)
def test_it(self):
- from repoze.bfg.interfaces import IRouteRequest
- from repoze.bfg.interfaces import IRequest
iface = self._callFUT('routename')
- self.failUnless(iface.extends(IRouteRequest))
- self.failUnless(iface.extends(IRequest))
self.assertEqual(iface.__name__, 'routename_IRequest')
class Test_add_global_response_headers(unittest.TestCase):