diff options
| author | Aymeric Augustin | 2013-11-24 10:42:43 +0100 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-11-24 11:01:44 +0100 | 
| commit | fe3df822111d3b56000deca354b0bceed7bde9cc (patch) | |
| tree | 8fe21689037cd975f83e7f70480b96e0ba2e3b6a /debug_toolbar/panels/__init__.py | |
| parent | 7d24008ac3d70796c1502215c665311d2f21d6fd (diff) | |
| download | django-debug-toolbar-fe3df822111d3b56000deca354b0bceed7bde9cc.tar.bz2 | |
Rename all panels consistently.
Enforce absolute imports to avoid clashing with built-in package names.
Thanks Jannis for his feedback.
Diffstat (limited to 'debug_toolbar/panels/__init__.py')
| -rw-r--r-- | debug_toolbar/panels/__init__.py | 16 | 
1 files changed, 13 insertions, 3 deletions
| diff --git a/debug_toolbar/panels/__init__.py b/debug_toolbar/panels/__init__.py index 37d7eb7..1ab500b 100644 --- a/debug_toolbar/panels/__init__.py +++ b/debug_toolbar/panels/__init__.py @@ -1,12 +1,14 @@ -from __future__ import unicode_literals +from __future__ import absolute_import, unicode_literals + +import warnings  from django.template.defaultfilters import slugify  from django.template.loader import render_to_string -class DebugPanel(object): +class Panel(object):      """ -    Base class for debug panels. +    Base class for panels.      """      # name = 'Base'      # template = 'debug_toolbar/panels/base.html' @@ -89,3 +91,11 @@ class DebugPanel(object):      def process_response(self, request, response):          pass + + +# Backward-compatibility for 1.0, remove in 2.0. +class DebugPanel(Panel): + +    def __init__(self, *args, **kwargs): +        warnings.warn("DebugPanel was renamed to Panel.", DeprecationWarning) +        super(DebugPanel, self).__init__(*args, **kwargs) | 
