My goal: In Pyramid, to call another view-callable, and to get a Response
object back without knowing any details about that view-callable.
In my Pyramid a
Not the precise solution you asked for, but a solution to the problem you describe:
Create a view class, of which both foo and bar are methods. Then bar can call self.foo()
Common view_configuration, such as the template name can be applied to the class, and then you can decorate each method with just the view name.
In short, the following should meet your needs, if I understand the problem correctly.
@view_defaults(renderer="foo.jinja2")
class WhereaboutsAreFoo(object):
@view_config(route-name="foo")
def foo_view(self):
return {"whereami" : "foo!"}
@view_config(route-name="bar")
def bar_view(self):
return self.foo_view()