I know this should be easy, but I am trying to assimilate cherrypy,
sqlobject, kid, and the TG glue all in one day.

What is the write way to inform TG about my second controller ?

I want to be able to go to a URL like
http://somewhere/Second/oneplusone and get my new controller in the
loop.

What is the write way to do this ??

-- thanks a bundle...Andrew


import turbogears
from turbogears import controllers
import cherrypy
#from model import Page, hub

#========================================

class Second( controllers.Root ):

    @turbogears.expose()
    def oneplusone( self ):
        return "2"

    @turbogears.expose()
    def twoplustwo( self ):
        return "four"

#========================================

class Root( controllers.Root ):

    second = Second()

    @turbogears.expose( html="project.templates.welcome" )
    def index( self ):
        return "hi"
        import time
        return dict( now=time.ctime() )
    
    def hi( self ):
        return "hi"

Reply via email to