SQLite delitem implementation

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

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()