1 """The base Controller API
3 Provides the BaseController class for subclassing.
5 from pylons import tmpl_context as c
6 from pylons.controllers import WSGIController
7 from pylons.i18n import _, ungettext, N_
8 from pylons.templating import render_mako as render
10 import bluechips.lib.helpers as h
11 from bluechips import model
12 from bluechips.model import meta
15 class BaseController(WSGIController):
17 def __call__(self, environ, start_response):
18 """Invoke the Controller"""
19 # WSGIController.__call__ dispatches to the Controller method
20 # the request is routed to. This routing information is
21 # available in environ['pylons.routes_dict']
23 return WSGIController.__call__(self, environ, start_response)
27 def update_sar(record, form_result):
29 Update a SQLAlchemy record with the results of a validated form submission
31 for key, value in form_result.items():
32 setattr(record, key, value)
34 __all__ = ['c', 'h', 'render', 'model', 'meta', '_', 'ungettext', 'N_',
35 'BaseController', 'update_sar']