l.s.w.canonicalurl : module documentation

Part of lp.services.webapp

Useful functions for dealing with Zope adapters.
Function nearest_context_with_adapter Find the nearest adapter in the url chain between obj and interface.
Function nearest_adapter Find the nearest adapter in the url chain between obj and interface.
Function nearest_provides_or_adapted Find the nearest object that provides or can be adapted to interface.
def nearest_context_with_adapter(obj, interface, name=u''):
Find the nearest adapter in the url chain between obj and interface.

The function looks upward though the canonical url chain and returns a tuple of (object, adapter).

Returnsif there is no object that has such an adapter in the url chain.
def nearest_adapter(obj, interface, name=u''):
Find the nearest adapter in the url chain between obj and interface.

The function looks upward though the canonical url chain and returns the first adapter it finds.

Returnsif there is no object that has such an adapter in the url chain.
def nearest_provides_or_adapted(obj, interface):
Find the nearest object that provides or can be adapted to interface.

The function looks upward through the canonical url chain.

Returnsif there is no object that provides or can be adapted in the url chain.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.