aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/panels/__init__.py
blob: 459e55061b665650553921ec23f08a879f3ec46d (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""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

    # Panel methods
    def __init__(self):
        pass

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

    def title(self):
        """Title showing in toolbar"""
        raise NotImplementedError

    def subtitle(self):
        """Subtitle showing until title in toolbar"""
        return ''

    def url(self):
        raise NotImplementedError

    def content(self):
        raise NotImplementedError

    # Standard middleware methods
    def process_request(self, request):
        pass

    def process_view(self, request, view_func, view_args, view_kwargs):
        pass

    def process_response(self, request, response):
        pass