SQLite delitem implementation

darcs-hash:20060201075358-86b55-07095573f5b30ad78829bdc933d7561c8a088294.gz
This commit is contained in:
David Rousselie committed 2006-02-01 08:53:58 +01:00
1 parent 0cf07b0a25
commit 52c6cb2aa9
3 files changed
+24 -13

No files matched your search

+10 -2
View File
@@ -60,7 +60,7 @@ class Storage(UserDict):
if regexp.search(key)]
def __delitem__(self, pk_tuple):
# print "Deleting " + "#".join(map(str, pk_tuple))
#print "Deleting " + "#".join(map(str, pk_tuple))
del self._registered[str("#".join(map(str, pk_tuple)))]
def get_spool_dir(self):
@@ -276,4 +276,12 @@ class SQLiteStorage(Storage):
def __delitem__(self, pk_tuple):
Storage.__delitem__(self, pk_tuple)
# TODO
cursor = self.__connection.cursor()
cursor.execute("""
delete from account where jid = ? and name = ?
""",
(pk_tuple[0],
pk_tuple[1]))
self.__connection.commit()
cursor.close()