l.a.b.r.LaunchpadSearchView(LaunchpadFormView) : class documentation

Part of lp.app.browser.root View In Hierarchy

A view to search for Launchpad pages and objects.
Method __init__ Initialize the view.
Method text Return the text or None.
Method start Return the start index of the batch.
Method page_title Page title.
Method page_heading Heading to display above the search results.
Method batch_heading Heading to display in the batch navigation.
Method focusedElementScript Focus the first widget when there are no matches.
Method bug Return the bug that matched the terms, or None.
Method question Return the question that matched the terms, or None.
Method pillar Return the project that matched the terms, or None.
Method person_or_team Return the person or team that matched the terms, or None.
Method pages Return the pages that matched the terms, or None.
Method has_shipit Return True is the search text contains shipit keywords.
Method has_exact_matches Return True if something exactly matched the search terms.
Method shipit_faq_url The shipit FAQ URL.
Method has_matches Return True if something matched the search terms, or False.
Method url Return the requested URL.
Method containsMatchingKind Return True if one of the items in kinds is not None, or False.
Method validate See LaunchpadFormView
Method search_action The Action executed when the user uses the search button.
Method searchPages Return the up to 20 pages that match the query_terms, or None.
Method _getDefaultSearchParams Return a dict of the search param set to their default state.
Method _updateSearchParams Sanitize the search_params and add the BatchNavigator params.
Method _getNumericToken Return the first group of numbers in the search text, or None.
Method _getNameToken Return the search text as a Launchpad name.
Method _getPersonOrTeam Return the matching active person or team.
Method _getDistributionOrProductOrProjectGroup Return the matching distribution, product or project, or None.

Inherited from LaunchpadFormView:

Method initialize Undocumented
Method render Return the body of the response.
Method extendFields Allow subclasses to extend the form fields.
Method setUpFields Undocumented
Method setUpWidgets Set up the widgets using the view's form fields and the context.
Method help_links Dictionary mapping field names to help links.
Method adapters Provide custom adapters for use when setting up the widgets.
Method action_url Set the default action URL for the form.
Method has_available_actions Does the view have any available actions that will render?
Method initial_values Override this in your subclass if you want any widgets to have
Method addError Add a form wide error.
Method getFieldError Get the error associated with a particular field.
Method setFieldError Set the error associated with a particular field.
Static Method validate_none Do not do any validation.
Method validate_widgets Validate the named form widgets.
Method error_count Undocumented
Method ajax_failure_handler Called by the form if validate() finds any errors.
Method validate_cancel Noop validation in case we cancel.
Method isSingleLineLayout Undocumented
Method isMultiLineLayout Undocumented
Method isCheckBoxLayout Undocumented
Method showOptionalMarker Should the (Optional) marker be shown?
Method _processNotifications Add any notification messages to the response headers.
Method _abort Abort the form edit.
Method _validate Check all widgets and perform any custom validation.
def __init__(self, context, request):
Initialize the view.

Set the state of the search_params and matches.

def _getDefaultSearchParams(self):
Return a dict of the search param set to their default state.
def _updateSearchParams(self):
Sanitize the search_params and add the BatchNavigator params.
@property
def text(self):
Return the text or None.
@property
def start(self):
Return the start index of the batch.
@property
def page_title(self):
Page title.
@property
def page_heading(self):
Heading to display above the search results.
@property
def batch_heading(self):
Heading to display in the batch navigation.
@property
def focusedElementScript(self):
Focus the first widget when there are no matches.
@property
def bug(self):
Return the bug that matched the terms, or None.
@property
def question(self):
Return the question that matched the terms, or None.
@property
def pillar(self):
Return the project that matched the terms, or None.
@property
def person_or_team(self):
Return the person or team that matched the terms, or None.
@property
def pages(self):
Return the pages that matched the terms, or None.
@property
def has_shipit(self):
Return True is the search text contains shipit keywords.
@property
def has_exact_matches(self):
Return True if something exactly matched the search terms.
@property
def shipit_faq_url(self):
The shipit FAQ URL.
@property
def has_matches(self):
Return True if something matched the search terms, or False.
@property
def url(self):
Return the requested URL.
def containsMatchingKind(self, kinds):
Return True if one of the items in kinds is not None, or False.
def validate(self, data):
See LaunchpadFormView
@safe_action
@action(u'Search', 'search')
def search_action(self, action, data):
The Action executed when the user uses the search button.

Saves the user submitted search parameters in an instance attribute.

def _getNumericToken(self, text):
Return the first group of numbers in the search text, or None.
def _getNameToken(self, text):
Return the search text as a Launchpad name.

Launchpad names may contain ^[a-z0-9][a-z0-9+.-]+$. See valid_name_pattern.

def _getPersonOrTeam(self, name):
Return the matching active person or team.
def _getDistributionOrProductOrProjectGroup(self, name):
Return the matching distribution, product or project, or None.
def searchPages(self, query_terms, start=0):
Return the up to 20 pages that match the query_terms, or None.
Parametersquery_termsThe unescaped terms to query for.
startThe index of the page that starts the set of pages.
ReturnsA SiteSearchBatchNavigator or None.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.