X-Git-Url: http://git.plutz.net/?p=tabnote;a=blobdiff_plain;f=tabnote;h=ee5d59cb50faba4828f235f8dd13f46977f6f773;hp=79295deab0a21e60c75a149ed5274ef3b2f6bfbd;hb=HEAD;hpb=6507e315fdfcd3c90a1420578f025b83dbc13337 diff --git a/tabnote b/tabnote index 79295de..ee5d59c 100755 --- a/tabnote +++ b/tabnote @@ -101,7 +101,7 @@ class Persistence(): if content: content = self.escape(content) else: content = '' self.dbcur.execute('INSERT INTO notes (uuid, label, content, revision, lastsync) VALUES ' + - '(lower(hex(randomblob(16))), "' + label + '", "' + content + + '(lower(hex(randomblob(16))), "' + str(label) + '", "' + str(content) + '", datetime(\'now\'), datetime(\'1970-01-01\'));') else: if content: @@ -111,7 +111,11 @@ class Persistence(): if label: self.dbcur.execute('UPDATE notes SET label = "' + self.escape(label) + '", revision = datetime(\'now\') WHERE uuid = "' + str(uuid) + '";') - return self.dbcur.lastrowid + + try: + self.dbcur.execute('SELECT uuid FROM notes WHERE seq = "' + str(self.dbcur.lastrowid) + '";') + return self.dbcur.fetchall()[0][0] + except: return 0 def delRecord(self, uuid): """