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

Part of lp.services.webapp View In Hierarchy

Add the decorated method to stepto traversals for a class.

A stepto method must take no arguments and return an object for the URL at
that point.

  @stepto('+foo')
  def traverse_foo(self):
      return getUtility(IFoo)

which looks up an object for '+foo', allowing a URL traversal that looks
like:

  launchpad.net/.../+foo

See also doc/navigation.txt.

This sets an attribute on the decorated function, equivalent to:

  if decorated.__stepto_traversals__ is None:
      decorated.__stepto_traversals__ = []
  decorated.__stepto_traversals__.append(argument)

Inherited from DecoratorAnnotator:

Method __init__ Undocumented
Method __call__ Undocumented
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.