X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/d807884e8aa5b94a79e5f130fd2ce711e287eb3a..dbb5ab771be406d90ac522e0ecd644e5ddb21e6f:/contrib/shipherd/models.py diff --git a/contrib/shipherd/models.py b/contrib/shipherd/models.py index 5146987..010aa9f 100644 --- a/contrib/shipherd/models.py +++ b/contrib/shipherd/models.py @@ -155,7 +155,7 @@ class NavigationManager(models.Manager): # A distinct query is not strictly necessary. TODO: benchmark the efficiency # with/without distinct. - targets = list(Node.objects.filter(navigation_items__in=cache['items']).distinct()) + targets = list(Node.objects.filter(navigation_items__in=items).distinct()) for cache in caches: for item in cache['items']: @@ -248,12 +248,12 @@ class NavigationItem(TreeEntity): params = self.reversing_parameters args = isinstance(params, list) and params or None kwargs = isinstance(params, dict) and params or None - return node.view.reverse(view_name, args=args, kwargs=kwargs, node=node) + subpath = node.view.reverse(view_name, args=args, kwargs=kwargs) else: subpath = self.url_or_subpath - while subpath and subpath[0] == '/': - subpath = subpath[1:] - return '%s%s' % (node.get_absolute_url(), subpath) + if subpath[0] != '/': + subpath = '/' + subpath + return node.construct_url(subpath) elif node is not None: return node.get_absolute_url() else: