memory contexte

This commit is contained in:
2026-04-27 16:09:08 +02:00
parent b23a1de6f3
commit 3ff5bf4d25
2 changed files with 106 additions and 4 deletions

View File

@@ -195,6 +195,27 @@ def add_task(title, client_name="", project_name="", details="", due_at=""):
return row_to_dict(db.execute("SELECT * FROM tasks WHERE id = ?", (cursor.lastrowid,)).fetchone())
def close_task(task_id):
with connect() as db:
row = db.execute(
"""
SELECT t.*, c.name AS client_name, p.name AS project_name
FROM tasks t
LEFT JOIN clients c ON c.id = t.client_id
LEFT JOIN projects p ON p.id = t.project_id
WHERE t.id = ? AND t.done = 0
""",
(task_id,),
).fetchone()
if not row:
return None
db.execute(
"UPDATE tasks SET done = 1, updated_at = CURRENT_TIMESTAMP WHERE id = ?",
(task_id,),
)
return row_to_dict(row)
def add_repository(name, project_name="", local_path="", remote_url="", main_branch=""):
name = clean_text(name) or derive_repo_name(local_path, remote_url)
if not name: