Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to add a callback hook while registering blueprint. #691

Closed
tonyseek opened this issue Mar 15, 2013 · 6 comments
Closed

Request to add a callback hook while registering blueprint. #691

tonyseek opened this issue Mar 15, 2013 · 6 comments

Comments

@tonyseek
Copy link

Should it send a signal while register_blueprint been calling? Sometime we may expect to initialize something while a new blueprint been loading.

@apiguy
Copy link

apiguy commented Mar 18, 2013

+1 for this. Would be very helpful for extensions. @tonyseek is there a pull request incoming?

@untitaker
Copy link
Contributor

Is #695 sufficient?

untitaker added a commit to untitaker/flask that referenced this issue Mar 20, 2013
@mitsuhiko
Copy link
Contributor

Not sure how that is useful? Wouldn't that run into bootstrapping issues as blueprints can only be registered as the application is instanciated? In that case I would assume the better approach is to just subclass Flask and customize the register method?

untitaker added a commit to untitaker/flask that referenced this issue Mar 21, 2013
@untitaker
Copy link
Contributor

Can anybody post some concrete examples where this hook might be useful, so @mitsuhiko is convinced?

@rcrowell
Copy link

I would like to decorate all of a blueprint's view functions with a custom @as_json function before registering the blueprint, without having to write @as_json on each one individually.

I was hoping to get a callback during blueprint-registration time to make these changes. Is there a better way?

@igarcez
Copy link

igarcez commented May 30, 2020

I would like to add db related initialization (creating indexes) in the blueprint registration callback

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants