示例#1
0
 def get_and_store_likes(self, user):
     '''
     Gets and stores your facebook likes to DB
     Both the get and the store run in a async task when
     FACEBOOK_CELERY_STORE = True
     '''
     if facebook_settings.FACEBOOK_CELERY_STORE:
         from django_facebook.tasks import get_and_store_likes
         get_and_store_likes.delay(user, self)
     else:
         self._get_and_store_likes(user)
示例#2
0
 def get_and_store_likes(self, user):
     '''
     Gets and stores your facebook likes to DB
     Both the get and the store run in a async task when
     FACEBOOK_CELERY_STORE = True
     '''
     if facebook_settings.FACEBOOK_CELERY_STORE:
         from django_facebook.tasks import get_and_store_likes
         get_and_store_likes.delay(user, self)
     else:
         self._get_and_store_likes(user)
示例#3
0
 def get_and_store_likes(self, auth_user):
     '''
     Gets and stores your facebook likes to DB
     Both the get and the store run in a async task when
     FACEBOOK_CELERY_STORE = True
     '''
     from django_facebook.utils import get_profile_class
     profile_class = get_profile_class()
     base_object = profile_class.objects.get(user=auth_user.id)
     if not len(base_object.likes):
         if facebook_settings.FACEBOOK_CELERY_STORE:
             from django_facebook.tasks import get_and_store_likes
             get_and_store_likes.delay(auth_user, self)
         else:
             self._get_and_store_likes(auth_user)