Add signaler app to intercept management commands and emit signals

This commit is contained in:
Roberto Rosario
2012-02-12 02:06:06 -04:00
parent d1621c6120
commit 31813f3412
7 changed files with 28 additions and 3 deletions
+1
View File
@@ -0,0 +1 @@
@@ -0,0 +1,13 @@
from django.contrib.staticfiles.management.commands import collectstatic
from signaler.signals import pre_collectstatic
class Command(collectstatic.Command):
"""
Wrapper for the collectstatic command
"""
def handle_noargs(self, *args, **kwargs):
pre_collectstatic.send(sender=self)
super(Command, self).handle_noargs(*args, **kwargs)
+3
View File
@@ -0,0 +1,3 @@
from django.db import models
# Create your models here.
+3
View File
@@ -0,0 +1,3 @@
from django.dispatch import Signal
pre_collectstatic = Signal()