diff options
| author | Aymeric Augustin | 2013-11-24 17:13:11 +0100 |
|---|---|---|
| committer | Aymeric Augustin | 2013-11-24 17:15:59 +0100 |
| commit | f52f266c691fd8bb80b21ab2a983118b914c04fa (patch) | |
| tree | 3cafd92796aae91e63abc3958ab1642745b6cfd8 /docs | |
| parent | c92f710125218755c275ae98581a4305e57fd3fa (diff) | |
| download | django-debug-toolbar-f52f266c691fd8bb80b21ab2a983118b914c04fa.tar.bz2 | |
Clean up and document the Panel API.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/conf.py | 3 | ||||
| -rw-r--r-- | docs/panels.rst | 40 |
2 files changed, 43 insertions, 0 deletions
diff --git a/docs/conf.py b/docs/conf.py index c2fcade..abde59b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,9 @@ import sys import os +os.environ['DJANGO_SETTINGS_MODULE'] = 'example.settings' +sys.path.append(os.path.dirname(os.path.dirname(__file__))) + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. diff --git a/docs/panels.rst b/docs/panels.rst index 39ddf7f..c766780 100644 --- a/docs/panels.rst +++ b/docs/panels.rst @@ -212,3 +212,43 @@ URL: https://github.com/playfire/django-debug-toolbar-user-panel Path: ``debug_toolbar_user_panel.panels.UserPanel`` Easily switch between logged in users, see properties of current user. + +API for third-party panels +-------------------------- + +Third-party panels must subclass :class:`~debug_toolbar.panels.Panel`, +according to the public API described below. Unless noted otherwise, all +methods are optional. + +Panels can ship their own templates, static files and views. They're no public +CSS or JavaScript API at this time, but they can assume jQuery is available. + +.. autoclass:: debug_toolbar.panels.Panel(*args, **kwargs) + + .. autoattribute:: debug_toolbar.panels.Panel.nav_title + + .. autoattribute:: debug_toolbar.panels.Panel.nav_subtitle + + .. autoattribute:: debug_toolbar.panels.Panel.has_content + + .. autoattribute:: debug_toolbar.panels.Panel.title + + .. autoattribute:: debug_toolbar.panels.Panel.template + + .. autoattribute:: debug_toolbar.panels.Panel.content + + .. automethod:: debug_toolbar.panels.Panel.get_urls + + .. automethod:: debug_toolbar.panels.Panel.enable_instrumentation + + .. automethod:: debug_toolbar.panels.Panel.disable_instrumentation + + .. automethod:: debug_toolbar.panels.Panel.record_stats + + .. automethod:: debug_toolbar.panels.Panel.get_stats + + .. automethod:: debug_toolbar.panels.Panel.process_request + + .. automethod:: debug_toolbar.panels.Panel.process_view + + .. automethod:: debug_toolbar.panels.Panel.process_response |
