def make_shell_context():
return dict(app=app, db=db, User=User, Role=Role)
manager.add_command("shell", Shell(make_context=make_shell_context))
python类Shell()的实例源码
def init_context():
return dict(app=app)
manager.add_command('shell',Shell(make_context=init_context))
def init_context():
return dict(app=app)
manager.add_command('shell',Shell(make_context=init_context))