| 172 |
ashish |
1 |
# -*- 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 pylons.i18n import _, ungettext, N_
|
|
|
8 |
from tw.api import WidgetBunch
|
|
|
9 |
import wiki20.model as model
|
|
|
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 |
return TGController.__call__(self, environ, start_response)
|