Skip to content

Instantly share code, notes, and snippets.

@yevgnenll
Created March 22, 2016 15:24
Show Gist options
  • Save yevgnenll/913cc3e5435a142b90da to your computer and use it in GitHub Desktop.
Save yevgnenll/913cc3e5435a142b90da to your computer and use it in GitHub Desktop.
from django.db.models.signals import post_save
from django.dispatch import receiver
from socials.models import Keyword
from socials.tasks import SocialsCrawlAllTask
@receiver(post_save, sender=Keyword)
def post_save_keyword(sender, instance, created, **kwargs):
if created:
task = SocialsCrawlAllTask()
task.delay(instance.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment