def publishTraverse(self, request, name): """Lookup a name - (request:IRequest, name:str) -> IView The 'request' argument is the publisher request object. The 'name' argument is the name that is to be looked up; it must be an ASCII string or Unicode object. If a lookup is not possible, raise a NotFound error. This method should return an object having the specified name and `self` as parent. The method can use the request to determine the correct object. """ _meth_id = "%s.publishTraverse" % self.__class__.__name__ log.debug("%s: name=%s __name__=%s __parent__=%s context=%s" % ( _meth_id, name, self.__name__, self.__parent__, getattr(self, "context", "UNDEFINED"))) try: assert self.publishTraverseResolver is not None return self.publishTraverseResolver(self, request, name) except (AssertionError,): pass # self.publishTraverseResolver is None, not an error except (NotFound,): pass # this is not really an error #debug.log_exc_info(sys.exc_info(), log.debug) except (TypeError, Exception): debug.log_exc_info(sys.exc_info(), log.error) traverser = ItemTraverser(self, request) return traverser.publishTraverse(request, name)
def publishTraverse(self, request, name): ob = ItemTraverser.publishTraverse(self, request, name) return ob.__of__(self.context)
def _getTraverser(self, context, request): return ItemTraverser(context, request)