-
Notifications
You must be signed in to change notification settings - Fork 2
/
menu.py
55 lines (49 loc) · 1.95 KB
/
menu.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""
This file was generated with the custommenu management command, it contains
the classes for the admin menu, you can customize this class as you want.
To activate your custom menu add the following to your settings.py::
ADMIN_TOOLS_MENU = 'mysite.menu.CustomMenu'
"""
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from admin_tools.menu import items, Menu
class CustomMenu(Menu):
"""
Custom Menu for mysite admin site.
"""
def __init__(self, **kwargs):
Menu.__init__(self, **kwargs)
self.children += [
items.MenuItem(_('Alarm'), reverse('admin:index')),
items.AppList(
_('Applications'),
exclude=('django.contrib.*',)
),
items.AppList(
_('Administration'),
models=('django.contrib.*',)
)
]
self.children.append(items.MenuItem(_('Ferramentas'),
children = [
items.MenuItem('Inserir Recomendador','code'),
items.MenuItem('Gerenciar Recomendadores','managercodes'),
]
))
self.children.append(items.MenuItem(_('Gráficos'),
children = [
items.MenuItem('Recomendação gerada','recomendacaoGerada'),
items.MenuItem('Recomendação acessada','recomendacaoAcessada'),
items.MenuItem('Recomendação aderida por clique','recomendacaoAderida'),
items.MenuItem('Recomendação aderida por recomendador','recomendacaoAderidaPorGeracao'),
items.MenuItem('Eficiência dos recomendadores','recomendacaoEficiencia'),
]
))
def init_with_context(self, context):
"""
Use this method if you need to access the request context.
"""
return super(CustomMenu, self).init_with_context(context)