diff options
Diffstat (limited to 'pyenc/db.py')
-rw-r--r-- | pyenc/db.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/pyenc/db.py b/pyenc/db.py index 3bf2bba..38edda1 100644 --- a/pyenc/db.py +++ b/pyenc/db.py @@ -1,6 +1,4 @@ -""" -Database connection for application -""" +"""Database connection for application.""" import click from flask import current_app, g @@ -8,16 +6,10 @@ from flask.cli import with_appcontext from .model import db -@with_appcontext -def init_db(): - db.create_all() - - @click.command('init-db') @with_appcontext def init_db_command(): - """ - """ + """Create database from command line.""" # init_db() # print(db) print(db) @@ -26,6 +18,7 @@ def init_db_command(): def init_app(app): + """Add database (and click) to given flask app.""" # app.teardown_appcontext(close_db) db.init_app(app) app.cli.add_command(init_db_command) |