aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels/__init__.py
blob: 29cec02ca001680a0addab8c75542ed56fc15520 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Base DebugPanel class"""

class DebugPanel(object):
    """
    Base class for debug panels.
    """
    # name = Base
    has_content = False # If content returns something, set to true in subclass
    
    def __init__(self, request):
        self.request = request

    def dom_id(self):
        return 'djDebug%sPanel' % (self.name.replace(' ', ''))

    def title(self):
        raise NotImplementedError

    def url(self):
        raise NotImplementedError

    def content(self):
        # TODO: This is a bit flaky in that panel.content() returns a string 
        # that gets inserted into the toolbar HTML template.
        raise NotImplementedError