carom-server/billard/signals.py
2021-10-24 11:03:33 +02:00

12 lines
371 B
Python

from django.db.models.signals import post_save
from django.dispatch import receiver
from django_simple_task import defer
from billard.models import LocationData
from billard.tasks import process_location_data
@receiver(post_save, sender=LocationData)
def update_location_data(sender, instance, **kwargs):
defer(process_location_data(sender=sender, kwargs=kwargs))