Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
f3d49f44
Commit
f3d49f44
authored
4 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
DB: Verbose switch přejmenován na SQLALCHEMY_ECHO
... pak funguje i s flaskovým mezikusem, aniž bychom se museli starat.
parent
2cce1b23
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
config.py.example
+1
-1
1 addition, 1 deletion
config.py.example
mo/db.py
+1
-1
1 addition, 1 deletion
mo/db.py
with
2 additions
and
2 deletions
config.py.example
+
1
−
1
View file @
f3d49f44
SQLALCHEMY_DATABASE_URI = "postgresql:///mo_submit"
SQLALCHEMY_DATABASE_URI = "postgresql:///mo_submit"
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
DB_VERBOSE
= False
SQLALCHEMY_ECHO
= False
SECRET_KEY = "FIXME"
SECRET_KEY = "FIXME"
...
...
This diff is collapsed.
Click to expand it.
mo/db.py
+
1
−
1
View file @
f3d49f44
...
@@ -253,7 +253,7 @@ def get_session() -> Session:
...
@@ -253,7 +253,7 @@ def get_session() -> Session:
if
_session
is
None
:
if
_session
is
None
:
if
_engine
is
None
:
if
_engine
is
None
:
import
config
import
config
_engine
=
create_engine
(
config
.
SQLALCHEMY_DATABASE_URI
,
echo
=
config
.
DB_VERBOSE
)
_engine
=
create_engine
(
config
.
SQLALCHEMY_DATABASE_URI
,
echo
=
config
.
SQLALCHEMY_ECHO
)
MOSession
=
sessionmaker
(
bind
=
_engine
)
MOSession
=
sessionmaker
(
bind
=
_engine
)
_session
=
MOSession
()
_session
=
MOSession
()
return
_session
return
_session
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment