Facun Chamut wrote:
> Apparently (no guarantees, it's fri @ 1:30 on the east coast), templates
> that are being called from 3 levels deep in cherrypy are not being affected
> by CSS. Uff, that sounds weird.
>
> An example:
> controllers.py
> import turbogears
> from turbogears import controllers
>
> class Root(controllers.RootController):
>     @turbogears.expose(template="dev10.templates.welcome")
>     def index(self):
>         import time
>         return dict(now=time.ctime())
>
> class blah:
>     @turbogears.expose(template="dev10.templates.welcome")
>     def index(self):
>         import time
>         return dict(now=time.ctime())
>
> class bleh:
>     @turbogears.expose(template="dev10.templates.welcome")
>     def index(self):
>         import time
>         return dict(now=time.ctime())
>
> in start.py we initialize:
> cherrypy.root=Root()
> cherrypy.root.blah=blah()
> cherrypy.root.blah.bleh = bleh()

This is not related to the css problem, anyway instead of modifying
start.py you can/should use your RootController class to do these
things (am I right Kevin?), for example:

class Root(controllers.RootController):

     blah = blah()

     blah.bleh = bleh()

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

or:

class Root(controllers.RootController):

     blah = blah()

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

 class blah:

     bleh = bleh()

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

so you don't need to modify your start.py.

Ciao
Michele

Reply via email to