Ticket #10646: memcache_incr_decr_require_key.patch
File memcache_incr_decr_require_key.patch, 667 bytes (added by , 16 years ago) |
---|
-
django/core/cache/backends/memcached.py
45 45 def close(self, **kwargs): 46 46 self._cache.disconnect_all() 47 47 48 def require_key(self, key): 49 if key not in self: 50 raise ValueError("Key '%s' not found!") 51 48 52 def incr(self, key, delta=1): 53 self.require_key(key) 49 54 return self._cache.incr(key, delta) 50 55 51 56 def decr(self, key, delta=1): 57 self.require_key(key) 52 58 return self._cache.decr(key, delta)