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