Navigation

Pyramid has a decorator= argument to its view configuration. It accepts
a single decorator that will wrap the mapped view callable represented by
the view configuration. That means that, no matter what the signature and
return value of the original view callable, the decorated view callable will
receive two arguments: context and request and will return a response
object:

1
2
3
4
5
6
7
8
9
10
11
12

# the decoratordefdecorator(view_callable):definner(context,request):returnview_callable(context,request)returninner# the view configuration@view_config(decorator=decorator,renderer='json')defmyview(request):return{'a':1}

But the decorator argument only takes a single decorator. What happens
if you want to use more than one decorator? You can chain them together: