carom-server/billard/signals.py

12 lines
371 B
Python
Raw Normal View History

2021-10-24 10:58:55 +02:00
from django.db.models.signals import post_save
from django.dispatch import receiver
2021-10-24 11:03:33 +02:00
from django_simple_task import defer
2021-10-24 10:58:55 +02:00
from billard.models import LocationData
from billard.tasks import process_location_data
@receiver(post_save, sender=LocationData)
def update_location_data(sender, instance, **kwargs):
2021-10-24 11:03:33 +02:00
defer(process_location_data(sender=sender, kwargs=kwargs))