Jump to >

This documentation covers the in-development release of Review Board. You can see the latest stable docs or all previous versions.


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
declared_fields = {'id': <django.forms.fields.IntegerField object>, 'model_filter': <django.forms.fields.MultipleChoiceField object>, 'q': <django.forms.fields.CharField object>}[source]