summaryrefslogtreecommitdiff
path: root/lib/grappelli/templates/admin_tools/menu/menu.txt
blob: 72d20dab55dda2f2b7fcb6e2cbbd6eca042b8aaa (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
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from admin_tools.menu import items, Menu

# to activate your custom menu add the following to your settings.py:
#
# ADMIN_TOOLS_MENU = '{{ project }}.{{ file }}.CustomMenu'

class CustomMenu(Menu):
    """
    Custom Menu for {{ project }} admin site.
    """
    def __init__(self, **kwargs):
        Menu.__init__(self, **kwargs)
        self.children.append(items.MenuItem(
            title=_('Dashboard'),
            url=reverse('admin:index')
        ))
        self.children.append(items.AppList(
            title=_('Applications'),
            models=('add.your.app.models.here',)
        ))
        self.children.append(items.AppList(
            title=_('Administration'),
            models=('django.contrib',)
        ))

    def init_with_context(self, context):
        """
        Use this method if you need to access the request context.
        """
        pass