source: cows/trunk/cows/pylons/project_templates/cows_server/+package+/lib/base.py_tmpl @ 4917

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/trunk/cows/pylons/project_templates/cows_server/+package+/lib/base.py_tmpl@4917
Revision 4917, 1.0 KB checked in by spascoe, 12 years ago (diff)

Created a Paste project template based on Dom's example server. This
was constructed by following the tutorial at
 http://pylonsbook.com/alpha1/simplesite_part_3 "Making SimpleSite? into a
Paste Project Template"

Line 
1"""The base Controller API
2
3Provides the BaseController class for subclassing, and other objects
4utilized by Controllers.
5"""
6from pylons import c, cache, config, g, request, response, session
7from pylons.controllers import WSGIController
8from pylons.controllers.util import abort, etag_cache, redirect_to
9from pylons.decorators import jsonify, validate
10from pylons.i18n import _, ungettext, N_
11from pylons.templating import render
12
13import {{package}}.lib.helpers as h
14import {{package}}.model as model
15
16class BaseController(WSGIController):
17
18    def __call__(self, environ, start_response):
19        """Invoke the Controller"""
20        # WSGIController.__call__ dispatches to the Controller method
21        # the request is routed to. This routing information is
22        # available in environ['pylons.routes_dict']
23        return WSGIController.__call__(self, environ, start_response)
24
25# Include the '_' function in the public names
26__all__ = [__name for __name in locals().keys() if not __name.startswith('_') \
27           or __name == '_']
Note: See TracBrowser for help on using the repository browser.