mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 10:54:18 +00:00
Add all necessary models to flask shell context
This commit is contained in:
parent
8f4cd9a375
commit
22114dd464
17
nopaque.py
17
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()
|
||||
|
Loading…
Reference in New Issue
Block a user