From 687debd118c601a261cd0a32905c5f5a18515c5c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 21 Nov 2009 05:07:44 +0000 Subject: - "Hybrid mode" applications (applications which explicitly used traversal *after* url dispatch via ```` 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. --- repoze/bfg/interfaces.py | 6 +++--- repoze/bfg/request.py | 4 +--- repoze/bfg/tests/test_request.py | 4 ---- 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): -- cgit v1.2.3