File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 14
14
from sqlalchemy_file .storage import StorageManager
15
15
from sqlalchemy_file .validators import ContentTypeValidator , SizeValidator
16
16
17
+ db = SQLAlchemy (engine_options = {"echo" : True })
17
18
app = Flask (__name__ )
18
19
app .config [
19
20
"SQLALCHEMY_DATABASE_URI"
20
21
] = "sqlite:////tmp/example.db?check_same_thread=False"
21
- db = SQLAlchemy (app , engine_options = { "echo" : True } )
22
+ db . init_app (app )
22
23
23
24
24
25
class Book (db .Model ):
@@ -120,5 +121,6 @@ def serve_files(storage, file_id):
120
121
"documents" , driver .get_container (container_name = "documents" )
121
122
)
122
123
123
- db .create_all ()
124
+ with app .app_context ():
125
+ db .create_all ()
124
126
app .run (debug = True )
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ apache-libcloud = ">=3.6.0,<3.7"
35
35
pytest = " ^7.2.0"
36
36
mypy = " 0.991"
37
37
black = " 22.10.0"
38
- ruff = " 0.0.143 "
38
+ ruff = " 0.0.146 "
39
39
sqlmodel = " ^0.0.8"
40
40
Pillow = " ^9.3.0"
41
41
fasteners = " ^0.18"
@@ -44,12 +44,11 @@ mkdocs-material = "^8.5.10"
44
44
PyMySQL = { extras = [" rsa" ], version = " ^1.0.2" }
45
45
psycopg2-binary = " ^2.9.5"
46
46
mkdocstrings = { extras = [" python" ], version = " ^0.19.0" }
47
- fastapi = " ^0.87 .0"
47
+ fastapi = " ^0.88 .0"
48
48
uvicorn = " ^0.20.0"
49
49
python-multipart = " ^0.0.5"
50
50
Flask = " ^2.2.2"
51
- Flask-SQLAlchemy = " ^2.5.1"
52
- importlib-metadata = { version = " <5.0" , python = " <=3.7" }
51
+ Flask-SQLAlchemy = " ^3.0.2"
53
52
54
53
55
54
[tool .coverage .report ]
You can’t perform that action at this time.
0 commit comments