I want to add a custom link to a ModelList group on django-admin-tools. I tried that but it didn't show the link. What am I missing ?
class CustomIndexDashboard(Dashboard):
columns = 2
def __init__(self, **kwargs):
Dashboard.__init__(self, **kwargs)
grupo = modules.ModelList('Matrículas',
[ 'core.models.Aluno',
'core.models.Matricula',
'core.models.ModuloAtivo',
])
item = items.MenuItem(u"Orçamentos", "%s%s" % (reverse('admin:core_matricula_changelist'), "?status__exact=O" ) )
grupo.children += [ item ]
self.children += [ grupo,
modules.ModelList('Controle de Presença', [
'core.models.Aula',
'core.models.Pauta',
'core.models.Presenca',
'core.models.PautaModulo',
])
]
I ran into same problem and Tried to use
items.MenuItem
like you did, but I got an error:Then I came to follwing solution:
Even if we need only one link, we should create
LinkList
Here is our
ModelList
:And the
Group
, where we unite link with models:Then just use
a_group
anywhere you want.