Jump to >

reviewboard.search.signal_processor

The signal processor for Review Board search.

class SignalProcessor(*args, **kwargs)[source]

Bases: haystack.signals.BaseSignalProcessor

“Listens for signals and updates the search index.

This will listen for any signals that would affect the search index, and invokes a suitable Haystack callback to immediately update the data stored in the index.

This only updates the search index if:

  1. Search is enabled.
  2. The current search engine backend supports on-the-fly indexing.
save_signals = [(<class 'reviewboard.reviews.models.review_request.ReviewRequest'>, <django.dispatch.dispatcher.Signal object>, u'review_request'), (<class 'django.contrib.auth.models.User'>, <django.dispatch.dispatcher.Signal object>, u'instance'), (<class 'reviewboard.accounts.models.Profile'>, <django.dispatch.dispatcher.Signal object>, u'instance')][source]
delete_signals = [(<class 'reviewboard.reviews.models.review_request.ReviewRequest'>, <django.dispatch.dispatcher.Signal object>), (<class 'django.contrib.auth.models.User'>, <django.dispatch.dispatcher.Signal object>)][source]
__init__(*args, **kwargs)[source]

Initialize the signal processor.

Parameters:
  • *args (tuple) – Positional arguments to pass to the parent constructor.
  • **kwargs (dict) – Keyword arguments to pass to the parent constructor.
setup()[source]

Register the signal handlers for this processor.

teardown()[source]

Unregister all signal handlers for this processor.

check_handle_save(instance_kwarg, **kwargs)[source]

Conditionally update the search index when an object is updated.

Parameters:
  • instance_kwarg (unicode) – The name of the instance parameter.
  • **kwargs (dict) – Signal arguments. These will be passed to handle_save().
check_handle_delete(**kwargs)[source]

Conditionally update the search index when an object is deleted.

Parameters:**kwargs (dict) – Signal arguments. These will be passed to handle_delete().