At http://www.turbogears.org/2.0/docs/main/Controllers.html#the-new-tg2-lookup-method, it describes how to make use of TG2.0's new lookup() method in a controller. The code mostly works, but runs up against a bug in the _find_object() function in tg/controllers.py. Specifically, the problem occurs on line 439:
if not remainder or remainder == ['']:
The problem is that remainder, as passed into the lookup() method, is actually a tuple, not a list. So this check always fails and it never gets to the index() method for the sub-controller.
The line should instead probably look like the following:
if not remainder or remainder == ('',):
I was able to workaround this problem in my implementation of the lookup() method as follows:
def lookup(self, blah, *remainder):
subController = SubController(blah)
remainderList = []
for item in remainder:
remainderList.append(item)
return subController, remainderList