def get_current_user(self): #if not self.current_user: uuid = self.get_cookie(config.SOCRightConfig['rightCookieName']) if None == uuid: return None user = redis_cache.getObj(uuid) return user
def query_user_by_name_cache( name): key = _user_by_name_key % name user = redis_cache.getObj(key) if None == user: user = query_one_by_name(name = name) redis_cache.setObj(key = key, val = user, time = config.cache['apiTimeOut']) return user