| @@ -120,8 +120,8 @@ def set_task(projectid, task_title, task_description, budget): | |||||
| """ | """ | ||||
| cursor = db.cursor() | cursor = db.cursor() | ||||
| query = ("INSERT INTO tasks (teamid, projectid, title, task_description, budget, task_status) VALUES (1, \"" + | query = ("INSERT INTO tasks (teamid, projectid, title, task_description, budget, task_status) VALUES (1, \"" + | ||||
| projectid + "\", \"" + task_title + "\", \"" + | |||||
| task_description + "\", \"" + budget + "\", \"waiting for delivery\")") | |||||
| projectid + "\", \"" + task_title + "\", \"" + | |||||
| task_description + "\", \"" + budget + "\", \"waiting for delivery\")") | |||||
| cursor.execute(query) | cursor.execute(query) | ||||
| db.commit() | db.commit() | ||||
| cursor.close | cursor.close | ||||
| @@ -140,3 +140,12 @@ def get_tasks_by_project_id(project_id): | |||||
| tasks = cursor.fetchall() | tasks = cursor.fetchall() | ||||
| cursor.close | cursor.close | ||||
| return tasks | return tasks | ||||
| def set_task_file(task_id, filename): | |||||
| cursor = db.cursor() | |||||
| query = ("INSERT INTO task_files (taskid, filename) VALUES (\"" + | |||||
| task_id + "\", \"" + filename + "\")") | |||||
| cursor.execute(query) | |||||
| db.commit() | |||||
| cursor.close() | |||||