Created
May 2, 2012 16:26
-
-
Save jkakar/2577948 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
class Thingy(Storm): | |
id = Int(...) | |
_cache = {} | |
def getValue(self): | |
if 'value' in self._cache: | |
return self._cache['value'] | |
else: | |
# Load value from the database and cache it. | |
def __storm_invalidated__(self): | |
self._cache = {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment