Skip to content

Commit 375f176

Browse files
committed
Flask-SQLAlchemy support into custom function.
1 parent aae77a7 commit 375f176

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

flask_appconfig/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ def serve(obj, host, port, processes, backends, list_only,
242242
click.echo('Exhausted list of possible backends', err=True)
243243
sys.exit(1)
244244

245+
246+
def register_db_cli():
247+
# FIXME: currently disabled
245248
@cli.group()
246249
@click.option('--model',
247250
'-m',
@@ -252,8 +255,8 @@ def serve(obj, host, port, processes, backends, list_only,
252255
'-e/-E',
253256
default=True,
254257
help='Overrides SQLALCHEMY_ECHO')
255-
@click.pass_obj
256-
def db(obj, model, db, echo):
258+
def db(model, db, echo):
259+
# FIXME: currently broken.
257260
click.secho('flask db is currently experimental. Use it at your '
258261
'own risk',
259262
fg='yellow',
@@ -269,10 +272,7 @@ def db(obj, model, db, echo):
269272
click.echo('Connected to database: {}'.format(obj['db']))
270273

271274
@db.command()
272-
@click.pass_obj
273-
def reset(obj):
274-
db = obj['db']
275-
275+
def reset():
276276
with obj['app'].app_context():
277277
click.echo('Resetting database')
278278
db.drop_all()

0 commit comments

Comments
 (0)