summaryrefslogtreecommitdiff
path: root/db_sqlite.py
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2023-09-16 09:36:14 -0400
committerLouie S <louie@example.com>2023-09-16 09:36:14 -0400
commit1b861b1b2c15ec617051b746f8d207fca11cb869 (patch)
tree88632cf327614ad2cf9ee74348529a0e032f13d5 /db_sqlite.py
parent5ec8db4908fab13292c9b030f92e2468b9460e99 (diff)
Manual entry coloring working
Diffstat (limited to 'db_sqlite.py')
-rw-r--r--db_sqlite.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/db_sqlite.py b/db_sqlite.py
index 7fe2745..189ac57 100644
--- a/db_sqlite.py
+++ b/db_sqlite.py
@@ -58,6 +58,8 @@ def createTables():
due_date TEXT DEFAULT NULL,
alt_due_date VARCHAR(255) DEFAULT NULL,
link VARCHAR(255) DEFAULT NULL,
+ color VARCHAR(255) DEFAULT NULL,
+ highlight VARCHAR(255) DEFAULT NULL,
done TINYINT(1) DEFAULT FALSE,
hidden TINYINT(1) DEFAULT FALSE
)
@@ -108,6 +110,8 @@ def loadFromTables():
due_date,
record.field("alt_due_date").value(),
record.field("link").value(),
+ record.field("color").value(),
+ record.field("highlight").value(),
record.field("done").value(),
record.field("hidden").value()))
@@ -158,7 +162,7 @@ def insertEntry(new_entry):
query = QSqlQuery()
query.prepare("""
- INSERT INTO entries (parent_id, description, due_date, alt_due_date, link) VALUES (:p_id, :desc, :due, :alt_due, :link)
+ INSERT INTO entries (parent_id, description, due_date, alt_due_date, link, color, highlight) VALUES (:p_id, :desc, :due, :alt_due, :link, :color, :highlight)
""")
query.bindValue(":p_id", new_entry.parent_id)
query.bindValue(":desc", new_entry.desc)
@@ -171,6 +175,8 @@ def insertEntry(new_entry):
query.bindValue(":due", "")
query.bindValue(":alt_due", new_entry.due_alt)
query.bindValue(":link", new_entry.link)
+ query.bindValue(":color", new_entry.color)
+ query.bindValue(":highlight", new_entry.highlight)
success = query.exec_()
# DEBUG
#print(query.lastError().text())
@@ -230,6 +236,8 @@ def updateEntry(entry):
due_date = :due,
alt_due_date = :alt_due,
link = :link,
+ color = :color,
+ highlight = :highlight,
done = :done,
hidden = :hidden
WHERE id = :id
@@ -244,6 +252,8 @@ def updateEntry(entry):
query.bindValue(":due", "")
query.bindValue(":alt_due", entry.due_alt)
query.bindValue(":link", entry.link)
+ query.bindValue(":color", entry.color)
+ query.bindValue(":highlight", entry.highlight)
query.bindValue(":done", entry.done)
query.bindValue(":hidden", entry.hidden)
query.bindValue(":id", entry.id)