diff --git a/poetry.lock b/poetry.lock index 5c9b1d2..4e8bd0e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -684,21 +684,6 @@ files = [ flask = ">=2.2.5" sqlalchemy = ">=2.0.16" -[[package]] -name = "flask-sqlalchemy-stubs" -version = "0.2" -description = "flask_sqlalchemy stubs" -optional = false -python-versions = "*" -files = [ - {file = "flask_sqlalchemy-stubs-0.2.tar.gz", hash = "sha256:e4656bf4ddfcc4092a79dc75456978fd6761302f62f56526221ca867bd65c4b4"}, - {file = "flask_sqlalchemy_stubs-0.2-py3-none-any.whl", hash = "sha256:7d8e21571b4ee92b15b9ad0dad0d1f488543272a85d76a58580df0ba6685142f"}, -] - -[package.dependencies] -mypy = ">=0.720" -typing-extensions = ">=3.7.4" - [[package]] name = "flask-wtf" version = "1.2.1" @@ -3267,20 +3252,22 @@ watchdog = ["watchdog (>=2.3)"] [[package]] name = "wtforms" -version = "3.1.2" -description = "Form validation and rendering for Python web development." +version = "2.3.3" +description = "A flexible forms validation and rendering library for Python web development." optional = false -python-versions = ">=3.8" +python-versions = "*" files = [ - {file = "wtforms-3.1.2-py3-none-any.whl", hash = "sha256:bf831c042829c8cdbad74c27575098d541d039b1faa74c771545ecac916f2c07"}, - {file = "wtforms-3.1.2.tar.gz", hash = "sha256:f8d76180d7239c94c6322f7990ae1216dae3659b7aa1cee94b6318bdffb474b9"}, + {file = "WTForms-2.3.3-py2.py3-none-any.whl", hash = "sha256:7b504fc724d0d1d4d5d5c114e778ec88c37ea53144683e084215eed5155ada4c"}, + {file = "WTForms-2.3.3.tar.gz", hash = "sha256:81195de0ac94fbc8368abbaf9197b88c4f3ffd6c2719b5bf5fc9da744f3d829c"}, ] [package.dependencies] -markupsafe = "*" +MarkupSafe = "*" [package.extras] email = ["email-validator"] +ipaddress = ["ipaddress"] +locale = ["Babel (>=1.3)"] [[package]] name = "xonsh" @@ -3326,4 +3313,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4" -content-hash = "db487ad820ada919b9066198862714cf6a9290fd19ea4468c6eb67fc18005278" +content-hash = "e93a67349b26077f6a64533c1fc3681017ee89c0a20ddf4989871a286165f3da" diff --git a/pyproject.toml b/pyproject.toml index f6c6efe..b0bebf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,11 +17,11 @@ include = ["src/feedback_linker/py.typed"] python = ">=3.8.1,<4" flask = ">=3.0.2" flask-wtf = ">=1.2.1" +wtforms = "<3" email-validator = ">=2.1.0.post1" sqlalchemy = ">=2.0.27" flask-sqlalchemy = ">=3.1.1" -types-wtforms = "^3.1.0.20240205" -sqlalchemy-stubs = "^0.4" + [tool.poetry.dev-dependencies] pytest = ">=7.3.2" @@ -48,6 +48,8 @@ mkdocstrings = ">=0.21.2" mkdocstrings-python = ">=1.1.2" makim = "1.13.0" containers-sugar = "1.11.1" +types-wtforms = ">=3.1.0.20240205" +sqlalchemy-stubs = ">=0.4" [tool.pytest.ini_options] testpaths = [ diff --git a/src/feedback_linker/app.py b/src/feedback_linker/app.py index 459f680..6635fc4 100644 --- a/src/feedback_linker/app.py +++ b/src/feedback_linker/app.py @@ -25,6 +25,7 @@ app = Flask(__name__) app.config['SECRET_KEY'] = 'your_secret_key' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///feedback_linker.db' + init_app(app) @@ -86,5 +87,4 @@ def submit_feedback() -> str: if __name__ == '__main__': - db.create_all() app.run(debug=True) diff --git a/src/feedback_linker/models.py b/src/feedback_linker/models.py index 4b97c13..6595c17 100644 --- a/src/feedback_linker/models.py +++ b/src/feedback_linker/models.py @@ -100,3 +100,5 @@ class Feedback(BaseModel): # type: ignore[name-defined] def init_app(app) -> None: """Initialize app for the database.""" db.init_app(app) + with app.app_context(): + db.create_all() diff --git a/src/feedback_linker/templates/base.html b/src/feedback_linker/templates/base.html index 677c710..09cea92 100644 --- a/src/feedback_linker/templates/base.html +++ b/src/feedback_linker/templates/base.html @@ -5,9 +5,26 @@ Feedback-Linker + + +