forked from jan/debianmemberportfolio
setup Pylons infrastructure
paster create -t pylons ... paster controller ddportfolio add support for sphinx
This commit is contained in:
parent
0c5816154b
commit
9c800c0ed8
27 changed files with 689 additions and 35 deletions
0
ddportfolioservice/lib/__init__.py
Normal file
0
ddportfolioservice/lib/__init__.py
Normal file
14
ddportfolioservice/lib/app_globals.py
Normal file
14
ddportfolioservice/lib/app_globals.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
"""The application's Globals object"""
|
||||
from pylons import config
|
||||
|
||||
class Globals(object):
|
||||
"""Globals acts as a container for objects available throughout the
|
||||
life of the application
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
"""One instance of Globals is created during application
|
||||
initialization and is available during requests via the 'g'
|
||||
variable
|
||||
"""
|
||||
pass
|
27
ddportfolioservice/lib/base.py
Normal file
27
ddportfolioservice/lib/base.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
"""The base Controller API
|
||||
|
||||
Provides the BaseController class for subclassing, and other objects
|
||||
utilized by Controllers.
|
||||
"""
|
||||
from pylons import c, cache, config, g, request, response, session
|
||||
from pylons.controllers import WSGIController
|
||||
from pylons.controllers.util import abort, etag_cache, redirect_to
|
||||
from pylons.decorators import jsonify, validate
|
||||
from pylons.i18n import _, ungettext, N_
|
||||
from pylons.templating import render
|
||||
|
||||
import ddportfolioservice.lib.helpers as h
|
||||
import ddportfolioservice.model as model
|
||||
|
||||
class BaseController(WSGIController):
|
||||
|
||||
def __call__(self, environ, start_response):
|
||||
"""Invoke the Controller"""
|
||||
# WSGIController.__call__ dispatches to the Controller method
|
||||
# the request is routed to. This routing information is
|
||||
# available in environ['pylons.routes_dict']
|
||||
return WSGIController.__call__(self, environ, start_response)
|
||||
|
||||
# Include the '_' function in the public names
|
||||
__all__ = [__name for __name in locals().keys() if not __name.startswith('_') \
|
||||
or __name == '_']
|
6
ddportfolioservice/lib/helpers.py
Normal file
6
ddportfolioservice/lib/helpers.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
"""Helper functions
|
||||
|
||||
Consists of functions to typically be used within templates, but also
|
||||
available to Controllers. This module is available to both as 'h'.
|
||||
"""
|
||||
from webhelpers import *
|
Loading…
Add table
Add a link
Reference in a new issue