Created
January 25, 2013 20:26
-
-
Save cshoe/4637547 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: from django.core.cache import cache | |
In [2]: key = 'blah' | |
In [3]: cache.incr('blah') | |
--------------------------------------------------------------------------- | |
ValueError Traceback (most recent call last) | |
<ipython-input-3-154660d05ec4> in <module>() | |
----> 1 cache.incr('blah') | |
/Users/shoe/dev/envs/rdb/lib/python2.6/site-packages/django/core/cache/backends/locmem.py in incr(self, key, delta, version) | |
82 value = self.get(key, version=version) | |
83 if value is None: | |
---> 84 raise ValueError("Key '%s' not found" % key) | |
85 new_value = value + delta | |
86 key = self.make_key(key, version=version) | |
ValueError: Key 'blah' not found | |
In [4]: cache.set('blah', 1, 20) | |
In [5]: cache.incr('blah') | |
Out[5]: 2 | |
In [6]: cache.incr('blah') | |
Out[6]: 3 | |
In [7]: cache.incr('blah') | |
--------------------------------------------------------------------------- | |
ValueError Traceback (most recent call last) | |
<ipython-input-7-154660d05ec4> in <module>() | |
----> 1 cache.incr('blah') | |
/Users/shoe/dev/envs/rdb/lib/python2.6/site-packages/django/core/cache/backends/locmem.py in incr(self, key, delta, version) | |
82 value = self.get(key, version=version) | |
83 if value is None: | |
---> 84 raise ValueError("Key '%s' not found" % key) | |
85 new_value = value + delta | |
86 key = self.make_key(key, version=version) | |
ValueError: Key 'blah' not found | |
In [8]: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment