flask-script
flask-script copied to clipboard
allow sub-manager tasks to use own app rather than parent's
it was hard for me to understand the logic in this method. i have tried to amend it to make the sub-manager task use its app rather than the parent's. all unit tests pass. perhaps another should be written to assert the correct app is used for default tasks.
the example in the readme does not work for me. when i call python manage.py runserver it starts the parent app (MyApp) rather than the sub-manager app (MyAdminApp).
def gen_admin(app, **kwargs):
from myweb.admin import MyAdminApp
## easiest but possibly incomplete way to copy your settings
return MyAdminApp(config=app.config, **kwargs)
sub_manager = Manager(gen_admin)
manager = Manager(MyApp)
manager.add_command("admin", sub_manager)
I see this issue too. The build is only failing because the build for the original branch was failing for Python 3.3 at that time. Rebasing would fix that.
Any word on getting in? As it stands right now the submanager functionality is broken because the __call__ function on the Manager doesn't allow sub managers to override the app with their own function. Seems to have been broken for a while.