def get_follows(self, user, user2=None, msg=None): follows = redis_db.smembers('%s:%s' % (FOLLOWS_KEY, user)) blocked = redis_db.smembers('%s:%s' % (BLOCKED_KEY, user)) ret = list(follows.difference(blocked)) app.logger.debug("get_follows:[%s],[ret:%s]" % (user, ret)) return ret
def get_friends(self, user, user2=None, msg=None): return list(redis_db.smembers('%s:%s' % (FRIENDS_KEY, user)))
def get_blocked(self, user, user2=None, msg=None): return list(redis_db.smembers('%s:%s' % (BLOCKED_KEY, user)))