l.a.b.q.SearchQuestionsView(UserSupportLanguagesMixin, LaunchpadFormView) : class documentation

Part of lp.answers.browser.questiontarget View In Hierarchy

Known subclasses: lp.answers.browser.person.PersonSearchQuestionsView, lp.answers.browser.question.SearchAllQuestionsView, lp.answers.browser.questiontarget.QuestionCollectionByLanguageView, lp.answers.browser.questiontarget.QuestionCollectionMyQuestionsView, lp.answers.browser.questiontarget.QuestionCollectionNeedAttentionView

View that can filter the target's question in a batched listing.

This view provides a search form to filter the displayed questions.

Method template The template to render the presentation.
Method render See LaunchpadView.
Method page_title Heading to display above the search results.
Method display_target_column Return True when the context has question targets to display.
Method setUpFields See LaunchpadFormView.
Method setUpWidgets See LaunchpadFormView.
Method createLanguageField Create a field to choose a set of languages.
Method validate Validate hook.
Method status_title_map Return a dictionary mapping set of statuses to their title.
Method context_is_project Return True when the context is a project.
Method unspoken_languages Return a formatted string of unspoken question languages.
Method empty_listing_message Message shown when there is no questions matching the filter.
Method getDefaultFilter Hook for subclass to provide a default search filter.
Method search_text Search text used by the filter.
Method status_filter Set of statuses to filter the search with.
Method context_question_languages Return the set of ILanguages used by this context's questions.
Method show_language_control Whether to render Language control, or not at all.
Method matching_faqs_count Return the FAQs matching the same keywords.
Method matching_faqs_url Return the URL to use to display the list of matching FAQs.
Method search_action Action executed when the user clicked the search button.
Method searchResults Return the questions corresponding to the search.
Method display_sourcepackage_column We display the source package column only on distribution.
Method formatSourcePackageName Format the source package name related to question.
Method can_configure_answers Can the user configure answers for the IQuestionTarget.

Inherited from UserSupportLanguagesMixin:

Method user_support_languages The set of user support languages.

Inherited from LaunchpadFormView:

Method __init__ Undocumented
Method initialize Undocumented
Method extendFields Allow subclasses to extend the form fields.
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 focusedElementScript Helper function to construct the script element content.
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.
@property
def template(self):
The template to render the presentation.

Subclasses can redefine this property to choose their own template.

def render(self):
See LaunchpadView.
@property
def page_title(self):
Heading to display above the search results.
@property
def display_target_column(self):
Return True when the context has question targets to display.
def setUpFields(self):
See LaunchpadFormView.
def setUpWidgets(self):
See LaunchpadFormView.
def createLanguageField(self):
Create a field to choose a set of languages.

Create a specialized vocabulary based on the user's preferred languages. If the user is anonymous, the languages submited in the browser's request will be used.

def validate(self, data):
Validate hook.

This validation method checks that a valid status is submitted.

@cachedproperty
def status_title_map(self):
Return a dictionary mapping set of statuses to their title.

This is used to compute dynamically the page heading and empty listing messages.

@property
def context_is_project(self):
Return True when the context is a project.
@property
def unspoken_languages(self):
Return a formatted string of unspoken question languages.

The string summarizes the questions that are in languages that no answer contact speaks. The string takes the form of an inline list with links to see the questions for each language: '_Hungarian_ (2), _Romanian_ (1)'. An empty string is returned when all questions are in a language spoken by the answer contacts.

This method is relevant to QuestionTargets. Subclasses of this View that want to list unspoken languages for other objects must provide their own implementation.

@property
def empty_listing_message(self):
Message shown when there is no questions matching the filter.
def getDefaultFilter(self):
Hook for subclass to provide a default search filter.
@property
def search_text(self):
Search text used by the filter.
@property
def status_filter(self):
Set of statuses to filter the search with.
@cachedproperty
def context_question_languages(self):
Return the set of ILanguages used by this context's questions.
@property
def show_language_control(self):
Whether to render Language control, or not at all.

When the QuestionTarget has questions in only one language, and that language is among the user's languages, we do not render the language control because there are no choices to be made.

@cachedproperty
def matching_faqs_count(self):
Return the FAQs matching the same keywords.
@property
def matching_faqs_url(self):
Return the URL to use to display the list of matching FAQs.
@safe_action
@action(_('Search'))
def search_action(self, action, data):
Action executed when the user clicked the search button.

Saves the user submitted search parameters in an instance attribute.

def searchResults(self):
Return the questions corresponding to the search.
@property
def display_sourcepackage_column(self):
We display the source package column only on distribution.
def formatSourcePackageName(self, question):
Format the source package name related to question.

Return an URL to the support page of the source package related to question or mdash if there is no related source package.

@property
def can_configure_answers(self):
Can the user configure answers for the IQuestionTarget.
API Documentation for Launchpad, generated by pydoctor at 2019-07-23 00:00:05.