witten
/
luminotes
Archived
1
0
Fork 0

Temporary hack so that cache sets are performed whenever save() is called,

regardless of commit flag. Without this, the file upload progress bar breaks
because it gets a stale File object out of the cache.

Eventually, it would be better if cache sets were only done condittionally
based on commit flag, and also whenever Database.commit() is called.
This commit is contained in:
Dan Helfman 2008-03-06 23:21:15 +00:00
parent 50367579c0
commit 8fb1d9a80e
1 changed files with 6 additions and 2 deletions

View File

@ -72,8 +72,12 @@ class Database( object ):
if commit:
connection.commit()
if self.__cache:
self.__cache.set( obj.cache_key, obj )
# FIXME: we shouldn't touch the cache unless there's actually a commit.
# the problem is that in self.commit() below, we don't know which objects
# to actually save into the cache
if self.__cache:
self.__cache.set( obj.cache_key, obj )
def commit( self ):
self.__get_connection().commit()