0
|
1 """The base Controller API
|
|
2
|
|
3 Provides the BaseController class for subclassing.
|
|
4 """
|
|
5 from pylons.controllers import WSGIController
|
|
6 from pylons.templating import render_mako as render
|
|
7 from pylons_app.model import meta
|
|
8
|
|
9 class BaseController(WSGIController):
|
|
10
|
|
11 def __call__(self, environ, start_response):
|
|
12 """Invoke the Controller"""
|
|
13 # WSGIController.__call__ dispatches to the Controller method
|
|
14 # the request is routed to. This routing information is
|
|
15 # available in environ['pylons.routes_dict']
|
|
16 try:
|
|
17 return WSGIController.__call__(self, environ, start_response)
|
|
18 finally:
|
51
|
19 meta.Session.remove()
|