flask-script icon indicating copy to clipboard operation
flask-script copied to clipboard

allow sub-manager tasks to use own app rather than parent's

Open emosbaugh opened this issue 11 years ago • 3 comments

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.

emosbaugh avatar Jun 24 '14 17:06 emosbaugh

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)

emosbaugh avatar Jun 24 '14 17:06 emosbaugh

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.

torotil avatar May 23 '15 08:05 torotil

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.

bitbier avatar Sep 09 '15 22:09 bitbier