-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add init_app()
method to DebugPanel
base class
#95
Add init_app()
method to DebugPanel
base class
#95
Conversation
|
||
Example:: | ||
|
||
class UMLDiagramPanel(DebugPanel): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably :)
What specifically are you referring to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's stuff about UMLDiagramPanel in there that I don't think is correct?
Oh, that's an example. Never mind.
init_app()
-method to DebugPanel
base classinit_app()
method to DebugPanel
base class
I know it's been a long time, but do you still have any interest in this? |
Adds a method `DebugPanel.init_app()` that gets called from `DebugToolbar.init_app()`. This allows DebugPanels to register their own routes, and do setup work that should go across requests (as opposed to per-request setup) and needs access to the Flask `app`-object.
aaf0ef1
to
5bf5e09
Compare
@macnewbold Thank you for the flag. I've rebased on latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done. I think this is a very handy hook to add to the collection for users to adjust behavior.
Adds a method
DebugPanel.init_app()
that gets called fromDebugToolbar.init_app()
.This allows
DebugPanels
to register their own routes, and do setup work that should go across requests (as opposed to per-request setup) and needs access to the Flaskapp
-object.