Skip to content

Instantly share code, notes, and snippets.

@jkakar
Created May 2, 2012 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkakar/2577948 to your computer and use it in GitHub Desktop.
Save jkakar/2577948 to your computer and use it in GitHub Desktop.
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