def connection(self): """ A simple property on the instance that return the connection stored on the class """ if not self._connection: self._connection = redis_connect(self.connection_settings) return self._connection
def connection(self): db_name = config.get_current_db_name() if not db_name in self._connections: self._connections[db_name] = redis_connect(config.DATABASES[db_name]) return self._connections[db_name]
def connection(self): db_name = config.get_current_db_name() if not db_name in self._connections: self._connections[db_name] = redis_connect( config.DATABASES[db_name]) return self._connections[db_name]