Part of lp.services.webapp View In Hierarchy
Add the decorated method to stepthrough traversals for a class.
A stepthrough method must take single argument that's the path segment for
the object that it's returning. A common pattern is something like:
@stepthrough('+foo')
def traverse_foo(self, name):
return getUtility(IFooSet).getByName(name)
which looks up an object in IFooSet called 'name', allowing a URL
traversal that looks like:
launchpad.net/.../+foo/name
See also doc/navigation.txt.
This sets an attribute on the decorated function, equivalent to:
if decorated.__stepthrough_traversals__ is None:
decorated.__stepthrough_traversals__ = []
decorated.__stepthrough_traversals__.append(argument)
Inherited from DecoratorAnnotator:
| Method | __init__ | Undocumented |
| Method | __call__ | Undocumented |