Remove use of 'navigation_object_name' template variable and simplify the use of the 'navigation_object_list' template variable

This commit is contained in:
Roberto Rosario
2015-04-05 01:45:30 -04:00
parent 31c49a2493
commit db340513d0
9 changed files with 107 additions and 169 deletions
+3 -3
View File
@@ -43,7 +43,7 @@ class Menu(object):
def bind_links(self, links, sources=None, position=0):
"""
Associate a link to a model, a view, or an url inside this menu
Associate a link to a model, a view inside this menu
"""
if sources:
for source in sources:
@@ -79,12 +79,12 @@ class Menu(object):
result = []
navigation_object_list = context.get('navigation_object_list', [{'object': 'object'}])
navigation_object_list = context.get('navigation_object_list', ['object'])
# Multiple objects
for navigation_object in navigation_object_list:
try:
resolved_navigation_object_list.append(Variable(navigation_object['object']).resolve(context))
resolved_navigation_object_list.append(Variable(navigation_object).resolve(context))
except VariableDoesNotExist:
pass