def handle_forum_post_save(instance, **kwargs): index_object.delay("ForumDocument", instance.id)
def handle_profile_save(instance, **kwargs): index_object.delay("ProfileDocument", instance.pk)
def handle_document_save(instance, **kwargs): if instance.current_revision: index_object.delay("WikiDocument", instance.pk)
def handle_answer_vote_delete(instance, **kwargs): index_object.delay("AnswerDocument", instance.answer_id)
def handle_question_vote_delete(instance, **kwargs): index_object.delay("QuestionDocument", instance.question_id) index_objects_bulk.delay( "AnswerDocument", list(instance.question.answers.values_list("pk", flat=True)) )
def handle_answer_delete(instance, **kwargs): delete_object.delay("AnswerDocument", instance.pk) index_object.delay("QuestionDocument", instance.question_id)
def handle_question_save(instance, **kwargs): if not isinstance(instance, Question): return index_object.delay("QuestionDocument", instance.pk) index_objects_bulk.delay("AnswerDocument", list(instance.answers.values_list("pk", flat=True)))