Commits

Mikhail Korobov committed 6d7f990

Update docs and module templates for new recommended import paths

  • Participants
  • Parent commits cce1d6c

Comments (0)

Files changed (6)

admin_tools/dashboard/templates/admin_tools/dashboard/dashboard.txt

 from django.utils.translation import ugettext_lazy as _
 from django.core.urlresolvers import reverse
-from admin_tools.dashboard.models import *
+from admin_tools.dashboard import Dashboard, AppIndexDashboard
+from admin_tools.dashboard import modules
 
 
 # to activate your index dashboard add the following to your settings.py:
 class CustomIndexDashboard(Dashboard):
     """
     Custom index dashboard for {{ project }}.
-    """ 
+    """
     def __init__(self, **kwargs):
         Dashboard.__init__(self, **kwargs)
 
         # append a link list module for "quick links"
-        self.children.append(LinkListDashboardModule(
+        self.children.append(modules.LinkListDashboardModule(
             title=_('Quick links'),
             layout='inline',
             draggable=False,
         ))
 
         # append an app list module for "Applications"
-        self.children.append(AppListDashboardModule(
+        self.children.append(modules.AppListDashboardModule(
             title=_('Applications'),
             exclude_list=('django.contrib',),
         ))
 
         # append an app list module for "Administration"
-        self.children.append(AppListDashboardModule(
+        self.children.append(modules.AppListDashboardModule(
             title=_('Administration'),
             include_list=('django.contrib',),
         ))
 
         # append a recent actions module
-        self.children.append(RecentActionsDashboardModule(
+        self.children.append(modules.RecentActionsDashboardModule(
             title=_('Recent Actions'),
             limit=5
         ))
 
         # append a feed module
-        self.children.append(FeedDashboardModule(
+        self.children.append(modules.FeedDashboardModule(
             title=_('Latest Django News'),
             feed_url='http://www.djangoproject.com/rss/weblog/',
             limit=5
         ))
 
-        # append another link list module for "support". 
-        self.children.append(LinkListDashboardModule(
+        # append another link list module for "support".
+        self.children.append(modules.LinkListDashboardModule(
             title=_('Support'),
             children=[
                 {
 class CustomAppIndexDashboard(AppIndexDashboard):
     """
     Custom app index dashboard for {{ project }}.
-    """ 
+    """
     def __init__(self, *args, **kwargs):
         AppIndexDashboard.__init__(self, *args, **kwargs)
 
         self.title = ''
 
         # append a model list module
-        self.children.append(ModelListDashboardModule(
+        self.children.append(modules.ModelListDashboardModule(
             title=self.app_title,
             include_list=self.models,
         ))
 
         # append a recent actions module
-        self.children.append(RecentActionsDashboardModule(
+        self.children.append(modules.RecentActionsDashboardModule(
             title=_('Recent Actions'),
             include_list=self.get_app_content_types(),
         ))

admin_tools/dashboard/templates/admin_tools/dashboard/dashboard_app_index.txt

 from django.utils.translation import ugettext_lazy as _
 from django.core.urlresolvers import reverse
-from admin_tools.dashboard.models import *
+from admin_tools.dashboard import AppIndexDashboard
+from admin_tools.dashboard import modules
 
 # create your custom modules here if you want, for example:
 #
-# class CustomDashboardModule(DashboardModule):
+# class CustomDashboardModule(modules.DashboardModule):
 #     pass
 #
 {% if warning %}
 class {{ app|capfirst }}Dashboard(AppIndexDashboard):
     """
     Document your custom app index dashboard.
-    """ 
+    """
     def __init__(self, app_title, models, *args, **kwargs):
         super(CustomAppIndexDashboard, self).__init__(*args, **kwargs)
 
         # append your modules here, example:
-        # self.append(RecentActionsDashboardModule(
+        # self.append(modules.RecentActionsDashboardModule(
         #     title=_('Recent Actions'),
         #     limit=5,
         #     include_list=models,

admin_tools/menu/__init__.py

+from admin_tools.menu.menus import *

admin_tools/menu/templates/admin_tools/menu/menu.txt

 from django.core.urlresolvers import reverse
 from django.utils.translation import ugettext_lazy as _
-from admin_tools.menu.models import *
+from admin_tools.menu import Menu
+from admin_tools.menu import items
 
 # to activate your custom menu add the following to your settings.py:
 #
     """
     def __init__(self, **kwargs):
         Menu.__init__(self, **kwargs)
-        self.children.append(MenuItem(
+        self.children.append(items.MenuItem(
             title=_('Dashboard'),
             url=reverse('admin:index')
         ))
-        self.children.append(AppListMenuItem(
+        self.children.append(items.AppListMenuItem(
             title=_('Applications'),
             exclude_list=('django.contrib',)
         ))
-        self.children.append(AppListMenuItem(
+        self.children.append(items.AppListMenuItem(
             title=_('Administration'),
             include_list=('django.contrib',)
         ))

docs/dashboard.rst

 The django-admin-tools dashboard and dashboard modules API
 ==========================================================
 
-This section describe the API of the django-admin-tools dashboard and 
+This section describe the API of the django-admin-tools dashboard and
 dashboard modules.
-Make sure you read this before creating your custom dashboard and 
+Make sure you read this before creating your custom dashboard and
 custom modules.
 
 The ``Dashboard`` class
 -----------------------
 
-.. autoclass:: admin_tools.dashboard.models.Dashboard
+.. autoclass:: admin_tools.dashboard.Dashboard
     :members:
 
 The ``AppIndexDashboard`` class
 -------------------------------
 
-.. autoclass:: admin_tools.dashboard.models.AppIndexDashboard
+.. autoclass:: admin_tools.dashboard.AppIndexDashboard
     :members:
 
 The ``DashboardModule`` class
 -----------------------------
 
-.. autoclass:: admin_tools.dashboard.models.DashboardModule
+.. autoclass:: admin_tools.dashboard.modules.DashboardModule
     :members:
 
 The ``LinkListDashboardModule`` class
 -------------------------------------
 
-.. autoclass:: admin_tools.dashboard.models.LinkListDashboardModule
+.. autoclass:: admin_tools.dashboard.modules.LinkListDashboardModule
     :members:
 
 The ``AppListDashboardModule`` class
 ------------------------------------
 
-.. autoclass:: admin_tools.dashboard.models.AppListDashboardModule
+.. autoclass:: admin_tools.dashboard.modules.AppListDashboardModule
     :members:
 
 The ``ModelListDashboardModule`` class
 --------------------------------------
 
-.. autoclass:: admin_tools.dashboard.models.ModelListDashboardModule
+.. autoclass:: admin_tools.dashboard.modules.ModelListDashboardModule
     :members:
 
 The ``RecentActionsDashboardModule`` class
 ------------------------------------------
 
-.. autoclass:: admin_tools.dashboard.models.RecentActionsDashboardModule
+.. autoclass:: admin_tools.dashboard.modules.RecentActionsDashboardModule
     :members:
 
 The ``FeedDashboardModule`` class
 ---------------------------------
 
-.. autoclass:: admin_tools.dashboard.models.FeedDashboardModule
+.. autoclass:: admin_tools.dashboard.modules.FeedDashboardModule
     :members:
 The ``Menu`` class
 ------------------
 
-.. autoclass:: admin_tools.menu.models.Menu
+.. autoclass:: admin_tools.menu.Menu
     :members:
 
 The ``MenuItem`` class
 ----------------------
 
-.. autoclass:: admin_tools.menu.models.MenuItem
+.. autoclass:: admin_tools.menu.items.MenuItem
     :members:
 
 The ``AppListMenuItem`` class
 -----------------------------
 
-.. autoclass:: admin_tools.menu.models.AppListMenuItem
+.. autoclass:: admin_tools.menu.items.AppListMenuItem
     :members:
 
 The ``BookmarkMenuItem`` class
 ------------------------------
 
-.. autoclass:: admin_tools.menu.models.BookmarkMenuItem
+.. autoclass:: admin_tools.menu.items.BookmarkMenuItem
     :members: