Example #1
0
def object_cache(key, value=None):
    if not value:
        tmp = cache.get(key)
        if not tmp: 
            return None
        return pickle.loads(tmp)
    else:
        cache.set(key, pickle.dumps(value))
        return value
Example #2
0
def object_cache(key, value=None):
    if not value:
        tmp = cache.get(key)
        if not tmp:
            return None
        return pickle.loads(tmp)
    else:
        cache.set(key, pickle.dumps(value))
        return value
Example #3
0
def cached_query(id, data=None, timeout=None):
    if data is None:
        return view_cache.get(id)
    return view_cache.set(id, data, timeout=timeout)