[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. upstream/0.9.5.5-717-g0f98819
Sebastian Krzyszkowiak
seba.dos1 at gmail.com
Sat Aug 6 08:17:18 UTC 2011
The following commit has been merged in the debian branch:
commit 83e3352845e7e9c3dcabd8fbbe89459188fca389
Author: Sebastian Krzyszkowiak <seba.dos1 at gmail.com>
Date: Thu Jul 9 21:16:49 2009 +0200
opimd: SQLite-*, remove added and updated fields, DELETE from db instead of setting deleted field to 1.
diff --git a/framework/subsystems/opimd/pimb_sqlite_calls.py b/framework/subsystems/opimd/pimb_sqlite_calls.py
index 05ec50e..540ae2f 100644
--- a/framework/subsystems/opimd/pimb_sqlite_calls.py
+++ b/framework/subsystems/opimd/pimb_sqlite_calls.py
@@ -72,9 +72,7 @@ class SQLiteCallBackend(Backend):
Answered INTEGER DEFAULT 0,
New INTEGER DEFAULT 0,
Replied INTEGER DEFAULT 0,
- deleted INTEGER DEFAULT 0,
- added INTEGER DEFAULT 0,
- updated INTEGER DEFAULT 0);""")
+ deleted INTEGER DEFAULT 0);""")
cur.execute("CREATE TABLE IF NOT EXISTS call_values (id INTEGER PRIMARY KEY, callId INTEGER, Field TEXT, Value TEXT)")
self.con.text_factory = sqlite3.OptimizedUnicode
@@ -139,9 +137,9 @@ class SQLiteCallBackend(Backend):
for (field_name, field_value) in call_data:
if field_name=='_backend_entry_id':
callId=field_value
- cur.execute('UPDATE calls SET deleted=1 WHERE id=?',(callId,))
- # cur.execute('DELETE FROM calls WHERE id=?',(callId,))
- # cur.execute('DELETE FROM call_values WHERE callId=?',(callId,))
+ # cur.execute('UPDATE calls SET deleted=1 WHERE id=?',(callId,))
+ cur.execute('DELETE FROM calls WHERE id=?',(callId,))
+ cur.execute('DELETE FROM call_values WHERE callId=?',(callId,))
self.con.commit()
cur.close()
@@ -160,7 +158,7 @@ class SQLiteCallBackend(Backend):
cur.execute('INSERT INTO call_values (field,value,callId) VALUES (?,?,?)',(field,value,callId))
else:
cur.execute('UPDATE call_values SET value=? WHERE field=? AND callId=?',(value,field,callId))
- cur.execute('UPDATE calls SET updated=1 WHERE id=?',(callId,))
+ # cur.execute('UPDATE calls SET updated=1 WHERE id=?',(callId,))
self.con.commit()
cur.close()
@@ -180,7 +178,7 @@ class SQLiteCallBackend(Backend):
call_data[field]=0
cur = self.con.cursor()
- cur.execute('INSERT INTO calls (Caller, Type, Timestamp, Timezone, Direction, Duration, Cost, Answered, New, Replied, added) VALUES (?,?,?,?,?,?,?,?,?,?,?)',(call_data['Caller'], call_data['Type'], call_data['Timestamp'], call_data['Timezone'], call_data['Direction'], call_data['Duration'], call_data['Cost'], call_data['Answered'], call_data['New'], call_data['Replied'], 1))
+ cur.execute('INSERT INTO calls (Caller, Type, Timestamp, Timezone, Direction, Duration, Cost, Answered, New, Replied) VALUES (?,?,?,?,?,?,?,?,?,?)',(call_data['Caller'], call_data['Type'], call_data['Timestamp'], call_data['Timezone'], call_data['Direction'], call_data['Duration'], call_data['Cost'], call_data['Answered'], call_data['New'], call_data['Replied']))
cid = cur.lastrowid
for field in call_data:
if not field in reqfields:
diff --git a/framework/subsystems/opimd/pimb_sqlite_contacts.py b/framework/subsystems/opimd/pimb_sqlite_contacts.py
index cd4e850..eba018c 100644
--- a/framework/subsystems/opimd/pimb_sqlite_contacts.py
+++ b/framework/subsystems/opimd/pimb_sqlite_contacts.py
@@ -73,9 +73,7 @@ class SQLiteContactBackend(Backend):
HomeLoc TEXT,
Department TEXT,
refid TEXT,
- deleted INTEGER DEFAULT 0,
- added INTEGER DEFAULT 0,
- updated INTEGER DEFAULT 0);""")
+ deleted INTEGER DEFAULT 0);""")
"""
Address 0-X Address address://
@@ -178,9 +176,9 @@ class SQLiteContactBackend(Backend):
for (field_name, field_value) in contact_data:
if field_name=='_backend_entry_id':
contactId=field_value
- cur.execute('UPDATE contacts SET deleted=1 WHERE id=?',(contactId,))
- # cur.execute('DELETE FROM contacts WHERE id=?',(contactId,))
- # cur.execute('DELETE FROM contact_values WHERE contactId=?',(contactId,))
+ # cur.execute('UPDATE contacts SET deleted=1 WHERE id=?',(contactId,))
+ cur.execute('DELETE FROM contacts WHERE id=?',(contactId,))
+ cur.execute('DELETE FROM contact_values WHERE contactId=?',(contactId,))
self.con.commit()
cur.close()
@@ -199,7 +197,7 @@ class SQLiteContactBackend(Backend):
cur.execute('INSERT INTO contact_values (field,value,contactId) VALUES (?,?,?)',(field,value,contactId))
else:
cur.execute('UPDATE contact_values SET value=? WHERE field=? AND contactId=?',(value,field,contactId))
- cur.execute('UPDATE contacts SET updated=1 WHERE id=?',(contactId,))
+ # cur.execute('UPDATE contacts SET updated=1 WHERE id=?',(contactId,))
self.con.commit()
cur.close()
@@ -217,7 +215,7 @@ class SQLiteContactBackend(Backend):
contact_data[field]=''
cur = self.con.cursor()
- cur.execute('INSERT INTO contacts (Name, Surname, Nickname, Birthdate, MarrDate, Partner, Spouse, MetAt, HomeLoc, Department, added) VALUES (?,?,?,?,?,?,?,?,?,?,?)',(contact_data['Name'], contact_data['Surname'], contact_data['Nickname'], contact_data['Birthdate'], contact_data['MarrDate'], contact_data['Partner'], contact_data['Spouse'], contact_data['MetAt'], contact_data['HomeLoc'], contact_data['Department'], 1))
+ cur.execute('INSERT INTO contacts (Name, Surname, Nickname, Birthdate, MarrDate, Partner, Spouse, MetAt, HomeLoc, Department) VALUES (?,?,?,?,?,?,?,?,?,?)',(contact_data['Name'], contact_data['Surname'], contact_data['Nickname'], contact_data['Birthdate'], contact_data['MarrDate'], contact_data['Partner'], contact_data['Spouse'], contact_data['MetAt'], contact_data['HomeLoc'], contact_data['Department']))
cid = cur.lastrowid
for field in contact_data:
if not field in reqfields:
diff --git a/framework/subsystems/opimd/pimb_sqlite_messages.py b/framework/subsystems/opimd/pimb_sqlite_messages.py
index 990d423..d69412b 100644
--- a/framework/subsystems/opimd/pimb_sqlite_messages.py
+++ b/framework/subsystems/opimd/pimb_sqlite_messages.py
@@ -73,9 +73,7 @@ class SQLiteMessagesBackend(Backend):
MessageRead INTEGER DEFAULT 0,
MessageSent INTEGER DEFAULT 0,
Processing INTEGER DEFAULT 0,
- deleted INTEGER DEFAULT 0,
- added INTEGER DEFAULT 0,
- updated INTEGER DEFAULT 0);""")
+ deleted INTEGER DEFAULT 0);""")
"""
----- Non-internal fields with static data ---------------------
@@ -167,9 +165,9 @@ class SQLiteMessagesBackend(Backend):
for (field_name, field_value) in message_data:
if field_name=='_backend_entry_id':
messageId=field_value
- cur.execute('UPDATE messages SET deleted=1 WHERE id=?',(messageId,))
- # cur.execute('DELETE FROM messages WHERE id=?',(messageId,))
- # cur.execute('DELETE FROM message_values WHERE messageId=?',(messageId,))
+ # cur.execute('UPDATE messages SET deleted=1 WHERE id=?',(messageId,))
+ cur.execute('DELETE FROM messages WHERE id=?',(messageId,))
+ cur.execute('DELETE FROM message_values WHERE messageId=?',(messageId,))
self.con.commit()
cur.close()
@@ -188,7 +186,7 @@ class SQLiteMessagesBackend(Backend):
cur.execute('INSERT INTO message_values (field,value,messageId) VALUES (?,?,?)',(field,value,messageId))
else:
cur.execute('UPDATE message_values SET value=? WHERE field=? AND messageId=?',(value,field,messageId))
- cur.execute('UPDATE messages SET updated=1 WHERE id=?',(messageId,))
+ # cur.execute('UPDATE messages SET updated=1 WHERE id=?',(messageId,))
self.con.commit()
cur.close()
@@ -214,7 +212,7 @@ class SQLiteMessagesBackend(Backend):
message_data[field]=0
cur = self.con.cursor()
- cur.execute('INSERT INTO messages (Source, Timestamp, Timezone, Direction, Title, Sender, TransmitLoc, Content, MessageRead, MessageSent, Processing, added) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)',(message_data['Source'], message_data['Timestamp'], message_data['Timezone'], message_data['Direction'], message_data['Title'], message_data['Sender'], message_data['TransmitLoc'], message_data['Content'], message_data['MessageRead'], message_data['MessageSent'], message_data['Processing'], 1))
+ cur.execute('INSERT INTO messages (Source, Timestamp, Timezone, Direction, Title, Sender, TransmitLoc, Content, MessageRead, MessageSent, Processing) VALUES (?,?,?,?,?,?,?,?,?,?,?)',(message_data['Source'], message_data['Timestamp'], message_data['Timezone'], message_data['Direction'], message_data['Title'], message_data['Sender'], message_data['TransmitLoc'], message_data['Content'], message_data['MessageRead'], message_data['MessageSent'], message_data['Processing']))
cid = cur.lastrowid
for field in message_data:
if not field in reqfields:
--
FSO frameworkd Debian packaging
More information about the pkg-fso-commits
mailing list