fixed issue 1176, truncate on GAE+SQL

This commit is contained in:
mdipierro
2012-11-24 10:58:44 -06:00
parent 43c97bd8cc
commit fe4713ad88
2 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.2.1 (2012-11-24 10:47:44) stable
Version 2.2.1 (2012-11-24 10:58:12) stable
+11 -6
View File
@@ -4010,12 +4010,17 @@ class DatabaseStoredFile:
self.data += data
def close_connection(self):
self.db.executesql(
"DELETE FROM web2py_filesystem WHERE path='%s'" % self.filename)
query = "INSERT INTO web2py_filesystem(path,content) VALUES ('%s','%s')"\
% (self.filename, self.data.replace("'","''"))
self.db.executesql(query)
self.db.commit()
if self.db is not None:
self.db.executesql(
"DELETE FROM web2py_filesystem WHERE path='%s'" % self.filename)
query = "INSERT INTO web2py_filesystem(path,content) VALUES ('%s','%s')"\
% (self.filename, self.data.replace("'","''"))
self.db.executesql(query)
self.db.commit()
self.db = None
def close(self):
self.close_connection()
@staticmethod
def exists(db, filename):