1 |
commit: 8e8de310d617629fba0887d7760bec6ea54dbf08 |
2 |
Author: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 28 10:03:15 2016 +0000 |
4 |
Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 28 10:04:14 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/grumpy.git/commit/?id=8e8de310 |
7 |
|
8 |
Turn off flask-sqlalchemy modification tracking to silence a warning and save resources |
9 |
|
10 |
We shouldn't need SQLALCHEMY_TRACK_MODIFICATIONS, so just disable it as suggested to |
11 |
avoid the warning and save these little resources. This is a flask-sqlalchemy specific |
12 |
session event tracking thing; sqlalchemy itself provides its own mechanism for this |
13 |
these days, and if we need something like that, we should probably use those, not |
14 |
this flask-sqlalchemy thing. |
15 |
|
16 |
backend/__init__.py | 1 + |
17 |
1 file changed, 1 insertion(+) |
18 |
|
19 |
diff --git a/backend/__init__.py b/backend/__init__.py |
20 |
index 46a4007..4d78cd8 100644 |
21 |
--- a/backend/__init__.py |
22 |
+++ b/backend/__init__.py |
23 |
@@ -3,6 +3,7 @@ from flask_sqlalchemy import SQLAlchemy |
24 |
|
25 |
app = Flask("frontend") # FIXME: Finish rearranging frontend/backend modules properly instead of pretending to be frontend in backend/__init__ because jinja templates are looked for from <what_is_passed_here>/templates |
26 |
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///../backend/grumpy.db" # FIXME: configuration support; weird ../ because of claiming we are "frontend" to Flask and want to keep the path the same it was before for now. But this problem should go away with config, at least for postgres :) |
27 |
+app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False |
28 |
db = SQLAlchemy(app) |
29 |
|
30 |
from frontend import * |