Browse Source

Correctly upload to task folder

https
jakobsn 6 years ago
parent
commit
29fa7b9c64
1 changed files with 11 additions and 2 deletions
  1. +11
    -2
      src/app/models/project.py

+ 11
- 2
src/app/models/project.py View File

@@ -120,8 +120,8 @@ def set_task(projectid, task_title, task_description, budget):
"""
cursor = db.cursor()
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)
db.commit()
cursor.close
@@ -140,3 +140,12 @@ def get_tasks_by_project_id(project_id):
tasks = cursor.fetchall()
cursor.close
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()

Loading…
Cancel
Save