mirror of
https://github.com/fergalmoran/dss.api.git
synced 2025-12-22 17:28:55 +00:00
16 lines
476 B
Python
Executable File
16 lines
476 B
Python
Executable File
from django.db import models
|
|
|
|
|
|
class QueuedActivityModelManager(models.Manager):
|
|
def contribute_to_class(self, model, name):
|
|
super(QueuedActivityModelManager, self).contribute_to_class(model, name)
|
|
|
|
self._bind_flush_signal(model)
|
|
|
|
def _bind_flush_signal(self, model):
|
|
models.signals.post_save.connect(send_activity_to_queue, model)
|
|
|
|
|
|
def send_activity_to_queue(sender, **kwargs):
|
|
instance = kwargs.pop('instance', False)
|
|
print(instance) |