l.s.w._.Navigation : class documentation

Part of lp.services.webapp View In Hierarchy

Base class for writing browser navigation components.

Note that the canonical_url part of Navigation is used outside of the browser context.

Method __init__ Initialize with context and maybe with a request.
Method traverse Override this method to handle traversal.
Method redirectSubTree Redirect the subtree to the given target URL.
Method publishTraverse Shim, to set objects in the launchbag when traversing them.
Method all_traversal_and_redirection_names Return the names of all the traversals and redirections defined.
Method stepto_traversals Return a dictionary containing all the stepto names defined.
Method stepthrough_traversals Return a dictionary containing all the stepthrough names defined.
Method redirections Return a dictionary containing all the redirections names defined.
Method browserDefault Undocumented
Method _all_methods Walk the class's __mro__ looking for methods in class dicts.
Method _combined_method_annotations Walk through all the methods in the class looking for attributes
Method _handle_next_object Do the right thing with the outcome of traversal.
Method _publishTraverse Traverse, like zope wants.
def __init__(self, context, request=None):
Initialize with context and maybe with a request.
def traverse(self, name):
Override this method to handle traversal.

Raise NotFoundError if the name cannot be traversed.

def redirectSubTree(self, target, status=301):
Redirect the subtree to the given target URL.
def publishTraverse(self, request, name):
Shim, to set objects in the launchbag when traversing them.

This needs moving into the publication component, once it has been refactored.

def _all_methods(self):
Walk the class's __mro__ looking for methods in class dicts.

This is careful to avoid evaluating descriptors.

def _combined_method_annotations(self, attrname):
Walk through all the methods in the class looking for attributes on those methods with the given name. Combine the values of these attributes into a single dict. Return it.
def _handle_next_object(self, nextobj, request, name):
Do the right thing with the outcome of traversal.

If we have a redirection object, then redirect accordingly.

If we have None, issue a NotFound error.

Otherwise, return the object.

@property
def all_traversal_and_redirection_names(self):
Return the names of all the traversals and redirections defined.
@property
def stepto_traversals(self):
Return a dictionary containing all the stepto names defined.
@property
def stepthrough_traversals(self):
Return a dictionary containing all the stepthrough names defined.
@property
def redirections(self):
Return a dictionary containing all the redirections names defined.
def _publishTraverse(self, request, name):
Traverse, like zope wants.
def browserDefault(self, request):
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.