toastdriven/queued_search — pull request #9 by arski (2013-10-07 10:44:33+00:00)
Title: Check for filter/exclude fields of an object before deciding if to index or delete

PR for https://github.com/toastdriven/queued_search/issues/8

In particular, I used to have something like `qs = self.get_model().objects.filter(foo=1).exclude(related__bar=True)` in my model's index's `index_queryset` method, but this is not being used in queued_search. So this fix makes it possible to define attributes like the following in a model to only index certain objects that pass a filter.

@staticmethod
def queue_filter():
return {'foo': (1,)}

@staticmethod
def queue_exclude():
return {'related.bar': (True,)}