diff --git a/__pycache__/app.cpython-310.pyc b/__pycache__/app.cpython-310.pyc index be02a61..e6c007b 100644 Binary files a/__pycache__/app.cpython-310.pyc and b/__pycache__/app.cpython-310.pyc differ diff --git a/app.py b/app.py index e1d188f..23961d3 100644 --- a/app.py +++ b/app.py @@ -44,6 +44,17 @@ def create(): content = request.form['content'] list_title = request.form['list'] +# --- create the new lists here as well --- + new_list = request.form['new_list'] + + # if a new title (list) is submitted add it to the database + if list_title == 'New List' and new_list: + conn.execute('INSERT INTO lists (title) VALUES (?)', + (new_list,)) + conn.commit() + #update list_title to refer to the newly added list + list_title = new_list + if not content: flash('Content is required!') return redirect(url_for('index')) diff --git a/database.db b/database.db index 51632ee..73aad5b 100644 Binary files a/database.db and b/database.db differ diff --git a/templates/create.html b/templates/create.html index 6370e2c..6367178 100644 --- a/templates/create.html +++ b/templates/create.html @@ -14,6 +14,7 @@
+ +
+ + +
+