Jump to >

reviewboard.search.forms

Forms for searching Review Board.

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

The Review Board search form.

This form is capable of searching for ReviewRequests and Users.

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

Available model filters.

clean_q()[source]

Clean the q field.

The field will be stripped of leading and trailing whitespace.

Returns

The stripped query.

Return type

unicode

clean_model_filter()[source]

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

search()[source]

Perform a search.

Returns

The search results.

Return type

haystack.query.SearchQuerySet