1 # -*- encoding: utf-8 -*
4 This file was generated with the customdashboard management command, it
5 contains the two classes for the main dashboard and app index dashboard.
6 You can customize these classes as you want.
8 To activate your index dashboard add the following to your settings.py::
9 ADMIN_TOOLS_INDEX_DASHBOARD = 'SIGMA.dashboard.CustomIndexDashboard'
11 And to activate the app index dashboard::
12 ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'SIGMA.dashboard.CustomAppIndexDashboard'
15 from django
.utils
.translation
import ugettext_lazy
as _
16 from django
.core
.urlresolvers
import reverse
18 from admin_tools
.dashboard
import modules
, Dashboard
, AppIndexDashboard
19 from admin_tools
.utils
import get_admin_site_name
22 class CustomIndexDashboard(Dashboard
):
24 Custom index dashboard for SIGMA.
26 def init_with_context(self
, context
):
27 site_name
= get_admin_site_name(context
)
29 # append an app list module for "Applications"
30 self
.children
.append(modules
.AppList(
32 exclude
=('django.contrib.*',),
35 # append an app list module for "Administration"
36 self
.children
.append(modules
.AppList(
38 models
=('django.contrib.*',),
41 # append a recent actions module
42 self
.children
.append(modules
.RecentActions(_('Recent Actions'), 5))