Hello,
I would like to know if there is a way to add a fallback view name
when
a context is found but none of the defined view names match. For
example, from the following example application:
# coding: utf8
from pyramid.config import Configurator
class Foo(dict):
pass
def make_root(request):
return {'foo': Foo()}
def foo(request):
return request.subpath
def bar(request):
return {"whoami": "bar", "subpath": request.subpath}
def start(global_config, **settings):
config = Configurator(settings=settings)
config.set_root_factory(make_root)
config.add_view(foo, context=Foo, renderer="json")
config.add_view(bar, name="bar", context=Foo, renderer="json")
return config.make_wsgi_app()
Traversal finds /foo and /foo/bar fine. However, would it be possible
to configure a view (with context=Foo) to be used when the view_name
is
not found?
Thanks in advance.