-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Load the content of panels dynamically #447
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
Load the content of panels dynamically #447
Conversation
This pull request causes three test failures. We need a better test strategy. |
|
||
toolbar_counter = 0 | ||
toolbar_maxsize = 10 # keep data for the last 10 requests | ||
toolbar_results = SortedDict() |
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.
No opinion really but what about collections.deque(maxlen=10)
? Then as you add more they automatically fall off the other end. You don't really have to keep count.
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.
I first tried using a deque
, but I need a dict-like behavior to look up items in get_saved_toolbar
.
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.
Ah, I see it now. Thanks.
Tests are now passing. For a reason that I don't understand, testing with Python 2.7 and Django 1.6 blocks on my computer. Adding debugging makes the failure disappear :( |
I'm going to wait for a better alternative to 668be71 to merge this. Otherwise it's good to go. I don't think the change in the signature of |
They made it impossible to preserve panel data after the end of a request.
This should drastically reduce the overhead of the browser toolbar when a page has a complex template structure or many SQL queries. This change is backwards-incompatible for third-party panels because it changes the signature of __init__. The JavaScript could probably be improved; I'm outside my comfort zone.
Load the content of panels dynamically
…ents-on-demand Load the content of panels dynamically
This should drastically reduce the overhead of the browser toolbar when
a page has a complex template structure or many SQL queries.