Commit 5ff1f7a0 by Łukasz Mierzwa

django-debug-toolbar==1.0 support

This will probably break compatibility with older versions of django-debug-toolbar
parent 13957ffa
...@@ -21,6 +21,7 @@ class MongoDebugPanel(DebugPanel): ...@@ -21,6 +21,7 @@ class MongoDebugPanel(DebugPanel):
""" """
name = 'MongoDB' name = 'MongoDB'
has_content = True has_content = True
template = 'mongo-panel.html'
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(MongoDebugPanel, self).__init__(*args, **kwargs) super(MongoDebugPanel, self).__init__(*args, **kwargs)
...@@ -66,12 +67,10 @@ class MongoDebugPanel(DebugPanel): ...@@ -66,12 +67,10 @@ class MongoDebugPanel(DebugPanel):
def url(self): def url(self):
return '' return ''
def content(self): def process_response(self, request, response):
context = self.context.copy() self.record_stats({
context['queries'] = operation_tracker.queries 'queries': operation_tracker.queries,
context['inserts'] = operation_tracker.inserts 'inserts': operation_tracker.inserts,
context['updates'] = operation_tracker.updates 'updates': operation_tracker.updates,
context['removes'] = operation_tracker.removes 'removes': operation_tracker.removes
return render_to_string('mongo-panel.html', context) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment