From 22114dd464517553d7c6f46983f99c57e0b9af2b Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Mon, 18 May 2020 14:47:04 +0200 Subject: [PATCH] Add all necessary models to flask shell context --- nopaque.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/nopaque.py b/nopaque.py index 9ae49f8c..b027530c 100644 --- a/nopaque.py +++ b/nopaque.py @@ -1,7 +1,8 @@ import eventlet eventlet.monkey_patch() # noqa from app import create_app, db, socketio -from app.models import Corpus, Job, Role, User, NotificationData +from app.models import (Corpus, CorpusFile, Job, JobInput, JobResult, + NotificationData, NotificationEmailData, Role, User) from flask_migrate import Migrate, upgrade import os @@ -12,11 +13,17 @@ migrate = Migrate(app, db) @app.shell_context_processor def make_shell_context(): - return {'db': db, - 'Corpus': Corpus, + return {'Corpus': Corpus, + 'CorpusFile': CorpusFile, + 'db': db, 'Job': Job, - 'User': User, - 'NotificationData': NotificationData} + 'JobInput': JobInput, + 'JobResult': JobResult, + 'NotificationData': NotificationData, + 'NotificationEmailData': NotificationEmailData, + 'Role': Role, + 'User': User + } @app.cli.command()