一 View Callables
Defining a View Callable as a Function:
from pyramid.response import Response
def hello_world(request):
return Response('Hello world!')
Defining a View Callable as a Class:
from pyramid.response import Response
class MyView(object):
def __init__(self, request):
self.request = request
def __call__(self):
return Response('hello')