Exemple #1
0
def handle_answer_vote_delete(instance, **kwargs):
    index_object.delay("AnswerDocument", instance.answer_id)
Exemple #2
0
def handle_document_save(instance, **kwargs):
    if instance.current_revision:
        index_object.delay("WikiDocument", instance.pk)
Exemple #3
0
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)))
Exemple #4
0
def handle_answer_delete(instance, **kwargs):
    delete_object.delay("AnswerDocument", instance.pk)
    index_object.delay("QuestionDocument", instance.question_id)
Exemple #5
0
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)))
Exemple #6
0
def handle_profile_save(instance, **kwargs):
    index_object.delay("ProfileDocument", instance.pk)
Exemple #7
0
def handle_forum_post_save(instance, **kwargs):
    index_object.delay("ForumDocument", instance.id)