l.s.w.i.INotificationResponse(Interface) : interface documentation

Part of lp.services.webapp.interfaces View In Hierarchy

This class is responsible for propagating any notifications that have been set when redirect() is called.
Method addNotification Append the given message to the list of notifications.
Method removeAllNotifications Remove all notifications.
Object notifications Undocumented
Method addDebugNotification Shortcut to addNotification(msg, DEBUG).
Method addInfoNotification Shortcut to addNotification(msg, INFO).
Method addWarningNotification Shortcut to addNotification(msg, WARNING).
Method addErrorNotification Shortcut to addNotification(msg, ERROR).
Method redirect Like IHTTPApplicationResponse.redirect, preserving notifications.
def addNotification(msg, level=BrowserNotificationLevel.INFO):
Append the given message to the list of notifications.

A plain string message will be CGI escaped. Passing a message that provides the IStructuredString interface will return a unicode string that has been properly escaped. Passing an instance of a Zope internationalized message will cause the message to be translated, then CGI escaped.

ParametersmsgThis may be a string, an instance of zope.i18n.Message, or an instance of IStructuredString.
levelOne of the BrowserNotificationLevel values: DEBUG, INFO, WARNING, ERROR.
def removeAllNotifications():
Remove all notifications.

This will be used when rendering an error page.

notifications =
Undocumented
def addDebugNotification(msg):
Shortcut to addNotification(msg, DEBUG).
def addInfoNotification(msg):
Shortcut to addNotification(msg, INFO).
def addWarningNotification(msg):
Shortcut to addNotification(msg, WARNING).
def addErrorNotification(msg):
Shortcut to addNotification(msg, ERROR).
def redirect(location, status=None, trusted=True):
Like IHTTPApplicationResponse.redirect, preserving notifications.

Also, for convenience we use trusted=True here, so that our callsites that redirect from lp.net to vhost.lp.net don't have to pass trusted=True explicitly.

API Documentation for Launchpad, generated by pydoctor at 2019-09-23 00:00:04.