예제 #1
0
파일: signals.py 프로젝트: 4johndoe/mygpo
from mygpo.subscriptions.signals import subscription_changed
from mygpo.suggestions.tasks import update_suggestions


def update_suggestions_on_subscription(sender, **kwargs):
    """ update a user's suggestions after one of his subscriptions change """
    user = kwargs['user']
    update_suggestions.delay(user)


subscription_changed.connect(update_suggestions_on_subscription,
                             dispatch_uid='update_suggestions_on_subscription')
예제 #2
0
from mygpo.subscriptions.signals import subscription_changed
from mygpo.users.tasks import sync_user


def sync_user_on_subscription(sender, **kwargs):
    """ synchronizes the user after one of his subscriptions has changed """
    user = kwargs['user']
    sync_user.delay(user)


subscription_changed.connect(sync_user_on_subscription,
                             dispatch_uid='sync_user_on_subscription')
예제 #3
0
파일: apps.py 프로젝트: webpigeon/mygpo
 def ready(self):
     Podcast = apps.get_model('podcasts.Podcast')
     subscription_changed.connect(update_suggestions_on_subscription,
                                  sender=Podcast)
예제 #4
0
파일: apps.py 프로젝트: 4johndoe/mygpo
 def ready(self):
     subscription_changed.connect(update_suggestions_on_subscription,
                                  sender=Podcast)
예제 #5
0
파일: apps.py 프로젝트: JeanFred/mygpo
 def ready(self):
     Podcast = apps.get_model('podcasts.Podcast')
     subscription_changed.connect(update_suggestions_on_subscription,
                                  sender=Podcast)