fixed issue 1176, truncate on GAE+SQL
This commit is contained in:
@@ -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
@@ -4010,12 +4010,17 @@ class DatabaseStoredFile:
|
|||||||
self.data += data
|
self.data += data
|
||||||
|
|
||||||
def close_connection(self):
|
def close_connection(self):
|
||||||
self.db.executesql(
|
if self.db is not None:
|
||||||
"DELETE FROM web2py_filesystem WHERE path='%s'" % self.filename)
|
self.db.executesql(
|
||||||
query = "INSERT INTO web2py_filesystem(path,content) VALUES ('%s','%s')"\
|
"DELETE FROM web2py_filesystem WHERE path='%s'" % self.filename)
|
||||||
% (self.filename, self.data.replace("'","''"))
|
query = "INSERT INTO web2py_filesystem(path,content) VALUES ('%s','%s')"\
|
||||||
self.db.executesql(query)
|
% (self.filename, self.data.replace("'","''"))
|
||||||
self.db.commit()
|
self.db.executesql(query)
|
||||||
|
self.db.commit()
|
||||||
|
self.db = None
|
||||||
|
|
||||||
|
def close(self):
|
||||||
|
self.close_connection()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def exists(db, filename):
|
def exists(db, filename):
|
||||||
|
|||||||
Reference in New Issue
Block a user