adjust signal
This commit is contained in:
parent
eaccacf453
commit
93903e23fb
@ -0,0 +1 @@
|
||||
default_app_config = 'billard.apps.BillardConfig'
|
@ -4,3 +4,6 @@ from django.apps import AppConfig
|
||||
class BillardConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'billard'
|
||||
|
||||
def ready(self):
|
||||
import billard.signals #noqa
|
||||
|
10
billard/signals.py
Normal file
10
billard/signals.py
Normal file
@ -0,0 +1,10 @@
|
||||
from django.db.models.signals import post_save
|
||||
from django.dispatch import receiver
|
||||
|
||||
from billard.models import LocationData
|
||||
from billard.tasks import process_location_data
|
||||
|
||||
|
||||
@receiver(post_save, sender=LocationData)
|
||||
def update_location_data(sender, instance, **kwargs):
|
||||
process_location_data(sender=sender, kwargs=kwargs)
|
Loading…
Reference in New Issue
Block a user