1 # Copyright (C) 2010, Red Hat, Inc.
2 # Written by Darryl L. Pierce
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 """The base Controller API."""
20 from tg
import TGController
, tmpl_context
21 from tg
.render
import render
22 from pylons
.i18n
import _
, ungettext
, N_
23 from tw
.api
import WidgetBunch
24 import ovirtserver
.model
as model
26 __all__
= ['Controller', 'BaseController']
29 class BaseController(TGController
):
31 Base class for the controllers in the application.
33 Your web application should have one of these. The root of
34 your application is used to compute URLs used by your app.
38 def __call__(self
, environ
, start_response
):
39 """Invoke the Controller"""
40 # TGController.__call__ dispatches to the Controller method
41 # the request is routed to. This routing information is
42 # available in environ['pylons.routes_dict']
44 return TGController
.__call
__(self
, environ
, start_response
)