Skip to content

Instantly share code, notes, and snippets.

@danielroseman
Created December 24, 2009 09:55
Show Gist options
  • Save danielroseman/263113 to your computer and use it in GitHub Desktop.
Save danielroseman/263113 to your computer and use it in GitHub Desktop.
import django
from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import DebugPanel
from haystack.backends import queries
class HaystackDebugPanel(DebugPanel):
"""
Panel that displays the Haystack queries.
"""
name = 'Haystack'
has_content = True
def nav_title(self):
return _('Haystack queries')
def nav_subtitle(self):
return "%s queries" % len(queries)
def url(self):
return ''
def title(self):
return 'Haystack Queries'
def content(self):
return "".join(["<p>%s<br><br></p>" % q for q in queries])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment