Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emosbaugh
Copy link

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
Copy link
Author

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)

@torotil
Copy link

torotil commented May 23, 2015

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.

arnuschky added a commit to arnuschky/flask-script that referenced this pull request Jun 23, 2015
@bitbier
Copy link

bitbier commented Sep 9, 2015

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.

dext0r added a commit to dext0r/flask-script that referenced this pull request Oct 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants