2 This file was generated with the custommenu management command, it contains
3 the classes for the admin menu, you can customize this class as you want.
5 To activate your custom menu add the following to your settings.py::
6 ADMIN_TOOLS_MENU = 'project.menu.CustomMenu'
9 from django
.core
.urlresolvers
import reverse
10 from django
.utils
.translation
import ugettext_lazy
as _
12 from admin_tools
.menu
import items
, Menu
15 class CustomMenu(Menu
):
17 Custom Menu for project admin site.
19 def __init__(self
, **kwargs
):
20 Menu
.__init__(self
, **kwargs
)
22 items
.MenuItem(_('Dashboard'), reverse('admin:index')),
26 exclude
=('django.contrib.*',)
28 items
.MenuItem('Rapports',
30 items
.MenuItem('Rapport des postes', reverse('rhr_postes')),
31 items
.MenuItem('Rapport des contrats', reverse('rhr_contrats')),
36 models
=('django.contrib.*',)
40 def init_with_context(self
, context
):
42 Use this method if you need to access the request context.
44 return super(CustomMenu
, self
).init_with_context(context
)