Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / lib / base.py @ e6029893

History | View | Annotate | Download (963 Bytes)

1 57f7cb3f Gabriel DE PERTHUIS
# -*- coding: utf-8 -*-
2
3
"""The base Controller API."""
4
5
from tg import TGController, tmpl_context
6
from tg.render import render
7
from tg import request
8
from pylons.i18n import _, ungettext, N_
9
from tw.api import WidgetBunch
10
11
__all__ = ['Controller', 'BaseController']
12
13
14
class BaseController(TGController):
15
    """
16
    Base class for the controllers in the application.
17

18
    Your web application should have one of these. The root of
19
    your application is used to compute URLs used by your app.
20

21
    """
22
23
    def __call__(self, environ, start_response):
24
        """Invoke the Controller"""
25
        # TGController.__call__ dispatches to the Controller method
26
        # the request is routed to. This routing information is
27
        # available in environ['pylons.routes_dict']
28
29
        request.identity = request.environ.get('repoze.who.identity')
30
        tmpl_context.identity = request.identity
31
        return TGController.__call__(self, environ, start_response)