Skip to content

Commit

Permalink
Add shell_context_processor to inject models to shell.
Browse files Browse the repository at this point in the history
  • Loading branch information
arikfr committed Dec 8, 2016
1 parent 1d18109 commit 81fb139
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions redash/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
def create(group):
app = current_app or create_app()
group.app = app

@app.shell_context_processor
def shell_context():
from redash import models
return dict(models=models)

return app


Expand Down

0 comments on commit 81fb139

Please sign in to comment.