Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix displaying instance of RawQuerySet in templates toolbar #326

Merged
merged 1 commit into from

2 participants

Nikita Kovaliov Jannis Leidel
Nikita Kovaliov

Should fix iss #309

Jannis Leidel jezdez merged commit c38449c into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 debug_toolbar/panels/template.py
6 debug_toolbar/panels/template.py
View
@@ -6,7 +6,7 @@
from django.template.context import get_standard_processors
from django.test.signals import template_rendered
from django.utils.translation import ugettext_lazy as _
-from django.db.models.query import QuerySet
+from django.db.models.query import QuerySet, RawQuerySet
from debug_toolbar.panels import DebugPanel
from debug_toolbar.utils.tracking.db import recording, SQLQueryTriggered
@@ -76,9 +76,9 @@ def _store_template_info(self, sender, **kwargs):
elif key == 'LANGUAGES' and isinstance(value, tuple):
temp_layer[key] = '<<languages>>'
# QuerySet would trigger the database: user can run the query from SQL Panel
- elif isinstance(value, QuerySet):
+ elif isinstance(value, (QuerySet, RawQuerySet)):
model_name = "%s.%s" % (value.model._meta.app_label, value.model.__name__)
- temp_layer[key] = '<<queryset of %s>>' % model_name
+ temp_layer[key] = '<<%s of %s>>' % (value.__class__.__name__.lower(), model_name)
else:
try:
recording(False)
Something went wrong with that request. Please try again.