Add pre and post signals to haystack's update index command

This commit is contained in:
Roberto Rosario
2012-04-11 16:46:28 -04:00
parent 71a3e16a01
commit 6a7ca922f0
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
from haystack.management.commands import update_index
from signaler.signals import post_update_index, pre_update_index
class Command(update_index.Command):
"""
Wrapper for the haystack's update_index command
"""
def handle(self, *args, **kwargs):
pre_update_index.send(sender=self)
super(Command, self).handle(*args, **kwargs)
post_update_index.send(sender=self)

View File

@@ -1,3 +1,5 @@
from django.dispatch import Signal
pre_collectstatic = Signal()
pre_update_index = Signal()
post_update_index = Signal()