2006-02-24 14:07:01 +08:00
|
|
|
"Dummy cache backend"
|
|
|
|
|
|
|
|
from django.core.cache.backends.base import BaseCache
|
|
|
|
|
|
|
|
class CacheClass(BaseCache):
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
pass
|
|
|
|
|
2010-09-13 02:45:26 +08:00
|
|
|
def add(self, key, *args, **kwargs):
|
|
|
|
self.validate_key(key)
|
2008-08-10 11:52:21 +08:00
|
|
|
return True
|
2007-10-20 23:16:34 +08:00
|
|
|
|
2007-01-12 23:16:55 +08:00
|
|
|
def get(self, key, default=None):
|
2010-09-13 02:45:26 +08:00
|
|
|
self.validate_key(key)
|
2007-01-12 23:16:55 +08:00
|
|
|
return default
|
2006-02-24 14:07:01 +08:00
|
|
|
|
2010-09-13 02:45:26 +08:00
|
|
|
def set(self, key, *args, **kwargs):
|
|
|
|
self.validate_key(key)
|
2006-02-24 14:07:01 +08:00
|
|
|
|
2010-09-13 02:45:26 +08:00
|
|
|
def delete(self, key, *args, **kwargs):
|
|
|
|
self.validate_key(key)
|
2006-02-24 14:07:01 +08:00
|
|
|
|
|
|
|
def get_many(self, *args, **kwargs):
|
2007-01-12 23:16:55 +08:00
|
|
|
return {}
|
2006-02-24 14:07:01 +08:00
|
|
|
|
2010-09-13 02:45:26 +08:00
|
|
|
def has_key(self, key, *args, **kwargs):
|
|
|
|
self.validate_key(key)
|
2006-02-24 14:07:01 +08:00
|
|
|
return False
|
2010-01-27 16:21:35 +08:00
|
|
|
|
|
|
|
def set_many(self, *args, **kwargs):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def delete_many(self, *args, **kwargs):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def clear(self):
|
|
|
|
pass
|