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

Subversion URL:
Revision 4917, 1.0 KB checked in by spascoe, 13 years ago (diff)

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

1"""The base Controller API
3Provides the BaseController class for subclassing, and other objects
4utilized by Controllers.
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
13import {{package}}.lib.helpers as h
14import {{package}}.model as model
16class BaseController(WSGIController):
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)
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.