Hi,

I am trying to create sub controllers for my application.   From the
online document, I should inherit Controller class for my
subcontroller, as shown in one of online examples (MovieController).
Supposedly the definition for Controller class is in base.py; however,
I could not find it there.  I attached the file "base.py" at the end
of this email.  Am I missing something?
Thanks in advance
TPN

from lib.base import BaseController, Controller
from tg import redirect

class MovieController(Controller):
    @expose()
    def index(self):
        redirect('list/')

    @expose()
    def list(self):
        return 'hello'

class RootController(BaseController):
    movie = MovieController()


-------
Here is all  I have from HelloWorld app   /helloworld/lib/base.py.  No
definition for Controller class.
------

"""The base Controller API."""

from tg import TGController, tmpl_context
from tg.render import render
from tg import request
from pylons.i18n import _, ungettext, N_
from tw.api import WidgetBunch
import helloworld.model as model

__all__ = ['Controller', 'BaseController']


class BaseController(TGController):
    """
    Base class for the controllers in the application.

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

    """

    def __call__(self, environ, start_response):
        """Invoke the Controller"""
        # TGController.__call__ dispatches to the Controller method
        # the request is routed to. This routing information is
        # available in environ['pylons.routes_dict']

        request.identity = request.environ.get('repoze.who.identity')
        tmpl_context.identity = request.identity
        return TGController.__call__(self, environ, start_response)

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to