Jump to >


Forms for searching Review Board.

class RBSearchForm(user=None, local_site=None, **kwargs)[source]

Bases: haystack.forms.ModelSearchForm

The Review Board search form.

This form is capable of searching for ReviewRequests and Users.

FILTER_ALL = u''[source]
FILTER_REVIEW_REQUESTS = u'reviewrequests'[source]
FILTER_USERS = u'users'[source]
FILTER_TYPES = {u'': {u'models': [<class 'reviewboard.reviews.models.review_request.ReviewRequest'>, <class 'django.contrib.auth.models.User'>], u'name': _(u'All results')}, u'reviewrequests': {u'models': [<class 'reviewboard.reviews.models.review_request.ReviewRequest'>], u'name': _(u'Review Requests')}, u'users': {u'models': [<class 'django.contrib.auth.models.User'>], u'name': _(u'Users')}}[source]

Available model filters.

__init__(user=None, local_site=None, **kwargs)[source]

Initialize the search form.

  • user (django.contrib.auth.models.User) –

    The user performing the search.

    Results will be limited to those visible to the user.

  • local_site (reviewboard.site.models.LocalSite) –

    The Local Site the search is being performed on.

    Results will be limited to those on the LocalSite.

  • **kwargs (dict) – Additional keyword arguments to forward to the parent form.

Clean the q field.

The field will be stripped of leading and trailing whitespace.

Returns:The stripped query.
Return type:unicode

Clean the model_filter field.

If no filter is provided, the default (all models) will be used.

Returns:The cleaned filter field.
Return type:list of unicode

Perform a search.

Returns:The search results.
Return type:haystack.query.SearchQuerySet