On 12/15/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi guys!
>
> I'm a webware user and I want to test newer tecnologies, I like the way
> cherrypy works and I was between turbogears and pylons, so I want to
> give a try to turbogears. My goal is to port a large system build over
> webware to turbogears. Well, I think I will have many question with the
> time :D
>
> The first one is about controllers.py. I like to organize my sites in
> subsections, as above:
>
> /site
>    /about
>    /services
>    /admin
>

You can use the "tgbig" quickstart template to get a more modular
controller layout:

    tg-admin quickstart --template=tgbig

This will create a controllers folder that will make it easier for you
to split up your controller classes.


> I try to do an arrange like this in tg and I was sucessfull with 2
> methods, the first one is...
>
> .  class Admin(controllers.RootController):
> .      @expose(template='cheetah:saraswati.templates.admin.index')
> .      def index(self):
> .          return {}
> .
> .  class Root(controllers.RootController):
> .      @expose(template="cheetah:saraswati.templates.index")
> .      def index(self):
> .          return {}
> .
> .      admin = Admin()
>
> ... and the second one:
>
> .  class Root(controllers.RootController):
> .      @expose(template="cheetah:saraswati.templates.index")
> .      def index(self):
> .          return {}
> .
> .      class Admin(controllers.RootController):
> .          @expose(template='cheetah:saraswati.templates.admin.index')
> .          def index(self):
> .              return {}
> .      admin = Admin()
--8<-- snip --8<--

The only controller that should use `controllers.RootController` is,
unsurprisingly, the Root controller.  The others should all use
`controllers.Controller`

    class AnotherController(controllers.Controller):
        pass

>
> What do you think? I have another question too. If I have 2 independent
> project, suppose one is the site project and the other one is a pool
> application. Is there a way to integrate the pool application inside
> the site project. I think I can because I can insert another controller
> inside the root controller, am I right?
>

I'm not sure what you're asking here.  If you're asking if you can run
two TG apps from one codebase, you probably could achieve this, but it
would be much more hassle than it's worth and it wouldn't be very
clear with respect to your code.

Hope this helps.

Lee

-- 
Lee McFadden

blog: http://www.splee.co.uk
work: http://fireflisystems.com
skype: fireflisystems

--~--~---------~--~----~------------~-------~--~----~
 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