Thanks Anthony. This will come in handy. Scott
On Mon, Feb 8, 2010 at 3:00 PM, Anthony Theocharis <[email protected]> wrote: > I should also point out: > > There are a few other caveats, including pagination/url keyword args/url > positional args not always working quite right together. Those are both > fixed in my company's custom fork of TG2.0 (awaiting merging into the > official version). > You can see that here: http://bitbucket.org/anthony.theocharis/tg-2_0. > > If you don't mind installing TG2.0 from our custom version > (http://bitbucket.org/anthony.theocharis/tg-2_0/get/0d074f180f6b.gz), then > that's probably your easiest way to get Routes working correctly right away. > > If you want to stick with the version you already have (probably the TG2.0.3 > release?), you can look at the code in my company's latest project: > http://github.com/simplestation/mediacore . The RoutingController is defined > in mediacore/lib/base.py, and you can see how routing is used in the various > controllers in mediacore/controllers/*.py and in the configuration > mediacore/config/app_cfg.py and mediacore/config/routing.py > > -- Anthony > > > On 8-Feb-10, at 11:24 AM, Anthony Theocharis wrote: >> >> Hi Scott, >> >> You're probably confused because the links in my second last post in that >> thread has expired. >> >> The posting has moved to >> http://getmediacore.com/blog/routes-in-turbogears2/ >> >> Essentially, to use Routes in TG2.0.x, you need to set up a custom >> RoutingController which your controllers must extend. >> >> so your SomeTestController(BaseController) would become >> SomeTestController(RoutingController) >> >> and you would define RoutingController where your BaseController is >> defined. (Probably in myapp/lib/base.py) >> >> If you have success, or are still confused, post back here and I'll try to >> help you further. >> >> -- Anthony >> >> PS: we're working to get this RoutingController included in TG2.0 >> officially, but development moves slowly there. Mark is very busy. >> >> On 5-Feb-10, at 5:34 AM, Scott wrote: >>> >>> I'm trying to get custom routes working in our TG2 app. I read >>> through this old thread: >>> >>> http://groups.google.com/group/turbogears/browse_thread/thread/16d446e0aa796778/a36120049cde432b >>> but I still don't know what I'm doing wrong or what's going on. I get >>> the impression things have changed since then. >>> >>> Does anyone have a working sample with custom routing that actually >>> works correctly? I'm trying to route to a sub-controller in a subdir >>> of my controllers directory. >>> >>> In app/controllers/sub/test.py: >>> >>> class SomeTestController(BaseController): >>> �...@expose() >>> def foo(self, *args, **kw): >>> return "hi" >>> >>> In my overridden setup_routes(): >>> >>> map.connect(None, '/test/:arg1/:arg2', >>> controller = 'sub.test.SomeTestController', >>> action = 'foo', >>> conditions = dict(method = ['GET'])) > > -- > 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. > > -- 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.

