예제 #1
0
 def unfollow_user(self, user):
     self.following.remove(user)
     # invalidate caches
     following_cache = UserFollowingCache(prekey=self.user.id)
     following_cache.invalidate_cache()
     followers_cache = UserFollowersCache(prekey=user.id)
     followers_cache.invalidate_cache()
예제 #2
0
 def unfollow_user(self, user):
     self.following.remove(user)
     # invalidate caches
     following_cache = UserFollowingCache(prekey=self.user.id)
     following_cache.invalidate_cache()
     followers_cache = UserFollowersCache(prekey=user.id)
     followers_cache.invalidate_cache()
예제 #3
0
 def get_following(self):
     """Gets User following
     Returns a list of User objects
     """
     c = UserFollowingCache(prekey=self.user.id)
     following = c.get()
     if following is None:
         following = self.following.all()
         c.cache_store(following)
     return following
예제 #4
0
 def get_following(self):
     """Gets User following
     Returns a list of User objects
     """
     c = UserFollowingCache(prekey=self.user.id)
     following = c.get()
     if following is None:
         following = self.following.all()
         c.cache_store(following)
     return following