Add plugin API for adding items to the admin navigation

This commit is contained in:
Raphael Michel
2015-03-21 18:15:43 +01:00
parent a0b1a2e11b
commit 591ded3ff2
4 changed files with 39 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
from django.conf import settings
from django.core.urlresolvers import resolve
from .signals import html_head
from .signals import html_head, nav_event
def contextprocessor(request):
@@ -20,4 +20,9 @@ def contextprocessor(request):
_html_head.append(response)
ctx['html_head'] = "".join(_html_head)
_nav_event = []
if hasattr(request, 'event'):
for receiver, response in nav_event.send(request.event, request=request):
_nav_event += response
ctx['nav_event'] = _nav_event
return ctx