l.s.w._.LaunchpadView(UserAttributeCache) : class documentation

Part of lp.services.webapp View In Hierarchy

Base class for views in Launchpad.

Available attributes and methods are:

Method private A view is private if its context is.
Method information_type A view has the information_type of its context.
Method information_type_description A view has the information_type_description of its context.
Method __init__ Undocumented
Method beta_features Undocumented
Method initialize Override this in subclasses.
Method page_description Return a string containing a description of the context.
Method template The page's template, if configured in zcml.
Method yui_version The version of YUI we are using.
Method yui_console_debug Hide console debug messages in production.
Method combo_url Return the URL for the combo loader.
Method render Return the body of the response.
Method __call__ Undocumented
Method getCacheJSON Undocumented
Method publishTraverse See IBrowserPublisher.
Method recommended_canonical_url Canonical URL to be recommended in metadata.
Method related_feature_info Related feature flags that are active for this context and scope.
Method _get_json_cache Undocumented
Method _isRedirected Return True if a redirect was requested.
Method _getErrorMessage Property getter for error_message.
Method _setErrorMessage Property setter for error_message.
Method _getInfoMessage Property getter for info_message.
Method _setInfoMessage Property setter for info_message.

Inherited from UserAttributeCache:

Method account Undocumented
Method user The logged-in Person, or None if there is no one logged in.
@property
def private(self):
A view is private if its context is.
@property
def information_type(self):
A view has the information_type of its context.
@property
def information_type_description(self):
A view has the information_type_description of its context.
def __init__(self, context, request):
Undocumented
def _get_json_cache(self):
Undocumented
@property
def beta_features(self):
Undocumented
def initialize(self):
Override this in subclasses.

Default implementation does nothing.

@property
def page_description(self):
Return a string containing a description of the context.

Typically this is the contents of the most-descriptive text attribute of the context, by default its 'description' attribute if there is one.

This will be inserted into the HTML meta description, and may eventually end up in search engine summary results, or when a link to the page is shared elsewhere.

This may be specialized by view subclasses.

Do not write eg "This is a page about...", just directly describe the object on the page.

@property
def template(self):
The page's template, if configured in zcml.
@property
def yui_version(self):
The version of YUI we are using.
@property
def yui_console_debug(self):
Hide console debug messages in production.
@property
def combo_url(self):
Return the URL for the combo loader.
def render(self):
Return the body of the response.

If the mime type of request.response starts with text/, then the result of this method is encoded to the charset of request.response. If there is no charset, it is encoded to utf8. Otherwise, the result of this method is treated as bytes.

XXX: Steve Alexander says this is a convenient lie. That is, its not quite right, but good enough for most uses.

def _isRedirected(self):
Return True if a redirect was requested.

Check if the response status is one of 301, 302, 303 or 307.

def __call__(self):
Undocumented
def _getErrorMessage(self):
Property getter for error_message.
def _setErrorMessage(self, error_message):
Property setter for error_message.

Enforces error_message values that are either None or implement IStructuredString.

def _getInfoMessage(self):
Property getter for info_message.
def _setInfoMessage(self, info_message):
Property setter for info_message.

Enforces info_message values that are either None or implement IStructuredString.

def getCacheJSON(self):
Undocumented
def publishTraverse(self, request, name):
See IBrowserPublisher.
@property
def recommended_canonical_url(self):
Canonical URL to be recommended in metadata.

Used to generate <link rel="canonical"> to hint that pages with different URLs are actually (at least almost) functionally and semantically identical.

See http://www.google.com/support/webmasters/bin/ answer.py?answer=139394 "Canonical is a long word that means my preferred or my primary."

Google (at least) will primarily, but not absolutely certainly, treat these pages as duplicates, so don't use this if there's any real chance the user would want to specifically find one of the non-duplicate pages.

Most views won't need this.

@property
def related_feature_info(self):
Related feature flags that are active for this context and scope.

This property describes all features marked as related_features in the view. is_beta means that the value is not the default value.

Return a dict of flags keyed by flag_name, with title and url as given by the flag's description. Value is the value in the current scope, and is_beta is true if this is not the default value.

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