add basic database functionality #9

Merged
celex merged 5 commits from 2-add-functionality-to-list-chores into main 2026-05-18 15:49:14 +01:00
Showing only changes of commit b8e2052549 - Show all commits
+2 -2
View File
@@ -6,7 +6,7 @@ from dataclasses import dataclass, fields
@dataclass @dataclass
class Task: class Task:
title: str title: str
done: bool is_done: bool
def __post_init__(self): def __post_init__(self):
for field in fields(self): for field in fields(self):
if field.type is bool: if field.type is bool:
@@ -22,7 +22,7 @@ class Database:
self.initialize_table() self.initialize_table()
def initialize_table(self): def initialize_table(self):
self.cur.execute("CREATE TABLE tasks(title TEXT, done INTEGER)") self.cur.execute("CREATE TABLE tasks(title TEXT, is_done INTEGER)")
def create_task(self, title: str, done:bool=False) -> None: def create_task(self, title: str, done:bool=False) -> None: