def handler_index_document(sender, **kwargs): task_index_document.apply_async(kwargs=dict( document_id=kwargs['instance'].document.pk))
def handler_index_document(sender, **kwargs): if kwargs['action'] in ('post_add', 'post_remove'): for pk in kwargs['pk_set']: task_index_document.apply_async(kwargs=dict(document_id=pk))