]> asedeno.scripts.mit.edu Git - bluechips.git/blob - bluechips/lib/base.py
Create Pylons app
[bluechips.git] / bluechips / lib / base.py
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
8 from bluechips.model import meta
9
10 class BaseController(WSGIController):
11
12     def __call__(self, environ, start_response):
13         """Invoke the Controller"""
14         # WSGIController.__call__ dispatches to the Controller method
15         # the request is routed to. This routing information is
16         # available in environ['pylons.routes_dict']
17         try:
18             return WSGIController.__call__(self, environ, start_response)
19         finally:
20             meta.Session.remove()
21