Add all necessary models to flask shell context

This commit is contained in:
Stephan Porada 2020-05-18 14:47:04 +02:00
parent 8f4cd9a375
commit 22114dd464

View File

@ -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()