Created
November 23, 2013 07:00
-
-
Save josiahcarlson/7611735 to your computer and use it in GitHub Desktop.
Doesn't record objects in the session, you would need to explicitly call `session.save()` in order to save any entities. Also, if an entity falls out of all scopes, it is deallocated and you need to fetch from Redis again.
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
''' | |
The Josiah Carlson recommended way of replacing the session object. This code | |
should be run prior to any subsequent imports/uses of the session object. | |
Released into the public domain. | |
''' | |
from rom import util | |
class NoSession(util.Session): | |
def add(self, obj): | |
"Don't record any objects in the session." | |
return | |
util.session = NoSession() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment