diff --git a/mysql/sql/init.sql b/mysql/sql/init.sql index b9903fa..8c5a8f4 100644 --- a/mysql/sql/init.sql +++ b/mysql/sql/init.sql @@ -78,8 +78,8 @@ CREATE TABLE projects_users ( CREATE TABLE tasks ( taskid INT UNSIGNED AUTO_INCREMENT, - projectid INT NOT NULL, - teamid INT UNSIGNED NOT NULL, + projectid UNSIGNED INT NOT NULL, + teamid INT UNSIGNED, title VARCHAR(200) NOT NULL, task_description VARCHAR(500), budget INT, diff --git a/src/app/models/project.py b/src/app/models/project.py index 50a67bc..6fd5018 100644 --- a/src/app/models/project.py +++ b/src/app/models/project.py @@ -26,3 +26,11 @@ def get_projects_by_status_and_category(categoryid, project_status): cursor.execute(query) projects = cursor.fetchall() return projects + +def set_waiting_task(projectid, title, task_description, budget): + cursor = db.cursor() + query = ("INSERT INTO tasks (pjojectid, title, task_description, budget) VALUES (\"" + + projectid + "\", \"" + title + "\", \"" + title + "\", \"" + + task_description + "\", \"" + budget + "\")") + cursor.execute(query) + diff --git a/src/app/templates/my_projects.html b/src/app/templates/my_projects.html index c6d7134..199df28 100644 --- a/src/app/templates/my_projects.html +++ b/src/app/templates/my_projects.html @@ -15,7 +15,7 @@ $def with (nav, categories, open_projects)