l.s.w._.stepthrough(DecoratorAnnotator) : class documentation

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
API Documentation for Launchpad, generated by pydoctor at 2019-10-22 00:00:06.