On 9/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Is there a way to add more functions to root in controller but to have
> it in a seperate file?
>
> I would like functions to have root scope but not be in a seperate
> file....
You can create a seperate controller class and then mount an instance
of it. Something like:
class FooController(controllers.Controller):
@expose(template=".templates.foo")
def index(self):
#blah
class Root(controllers.RootController):
foo = FooController()
You can keep classes in seperate files or folders in the usual way
(just import the name of the file, or in a dir with an __init__.py and
import dirname.filename)
Ed
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---