mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 16:55:42 +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
|
import eventlet
|
||||||
eventlet.monkey_patch() # noqa
|
eventlet.monkey_patch() # noqa
|
||||||
from app import create_app, db, socketio
|
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
|
from flask_migrate import Migrate, upgrade
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -12,11 +13,17 @@ migrate = Migrate(app, db)
|
|||||||
|
|
||||||
@app.shell_context_processor
|
@app.shell_context_processor
|
||||||
def make_shell_context():
|
def make_shell_context():
|
||||||
return {'db': db,
|
return {'Corpus': Corpus,
|
||||||
'Corpus': Corpus,
|
'CorpusFile': CorpusFile,
|
||||||
|
'db': db,
|
||||||
'Job': Job,
|
'Job': Job,
|
||||||
'User': User,
|
'JobInput': JobInput,
|
||||||
'NotificationData': NotificationData}
|
'JobResult': JobResult,
|
||||||
|
'NotificationData': NotificationData,
|
||||||
|
'NotificationEmailData': NotificationEmailData,
|
||||||
|
'Role': Role,
|
||||||
|
'User': User
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@app.cli.command()
|
@app.cli.command()
|
||||||
|
Loading…
Reference in New Issue
Block a user