Switched nav caching to cache the entire set of nodes for the navigation, not just...
[philo.git] / contrib / navigation / templatetags / navigation.py
index c74891b..11fdb44 100644 (file)
@@ -8,15 +8,7 @@ register = template.Library()
 
 @register.filter
 def get_navigation(node):
-       roots = Navigation.objects.for_node(node)
-       qs = None
-       for root in roots:
-               root_qs = root.get_descendants(include_self=True).complex_filter({'%s__lte' % root._mptt_meta.level_attr: root.get_level() + root.depth}).exclude(depth__isnull=True)
-               if qs is None:
-                       qs = root_qs
-               else:
-                       qs |= root_qs
-       return qs
+       return Navigation.objects.closest_navigation(node)
 
 @register.filter
 def is_active(navigation, request):