-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
panels(templates): avoid evaluating LazyObject #1833
Conversation
Hey, Thanks for your contribution! I have questions:
|
For me, the reason was an expensive SQL query. I turned something possibly expensive (and rarely used) to a SimpleLazyObject has PS: |
Thanks for the explanation! Makes sense.
I approve :) |
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.
Looks good! Two minor comments.
- this makes it show evaluated querysets which were used in the template - removes completely context processing when SHOW_TEMPLATE_CONTEXT is disabled
LazyObject is typically used for something expensive to evaluate, so avoid evaluating it just for showing it in the debug toolbar.
for more information, see https://pre-commit.ci
Thanks! |
Description
LazyObject is typically used for something expensive to evaluate, so avoid evaluating it just for showing it in the debug toolbar.
Fixes # (issue)
Checklist:
docs/changes.rst
.I will look at writing tests once I get an approval, that this is a viable approach.