Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2177 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

Provide a way to mount two controllers at the same URL

Reported by: jorge.vargas Owned by: faide
Priority: normal Milestone: 2.0rc1
Component: Documentation Version: trunk
Severity: normal Keywords:
Cc:

Description

This is specially important when working with composite apps, perhaps an example is best.

You have a blog application and your site, the blog exposes urls as /articles, /<var>, where /<var> stands for "Pages", your site exposes '/login', '/logout'. therefore combining the two will render the following sitemap.

/login (RootController)
/logout (RootController)
/articles (BlogController)
/about (BlogController)
/contact (BlogController)

I'm slotting this to 2.0 because is a feature I want, but if someone believe it's more inclined to the 2.1 feature set please move it there.

Change History

comment:1 Changed 10 years ago by mramm

  • Milestone changed from 2.0 to 2.1

I'm not sure how this can be done easily with tg2 without dropping down to routes, but the routes based solution does work now, so perhaps that's the best way to do it?

comment:2 Changed 10 years ago by jorge.vargas

We'll tackle this after 2.0 maybe at pycon ;)

comment:3 Changed 10 years ago by jorge.vargas

  • Component changed from TurboGears to Documentation
  • Milestone changed from 2.1 to 2.0

I totally overlooked the obvious. Thanks to precious for the idea. This doesn't even requires code changes.

class MYController(RootController,BlogController):
    pass

comment:4 Changed 10 years ago by mramm

  • Status changed from new to closed
  • Resolution set to fixed

comment:5 Changed 10 years ago by mramm

  • Milestone changed from 2.0 to 2.0rc1
Note: See TracTickets for help on using tickets.