From 36f395364e4467720c550c829d1bfec2e9da5d5f Mon Sep 17 00:00:00 2001 From: melinath Date: Fri, 18 Jun 2010 11:21:42 -0400 Subject: [PATCH] Added get_path fallback to slug to increase information flow by reducing the number of ? displayed --- models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models.py b/models.py index 265df32..b66c4c3 100644 --- a/models.py +++ b/models.py @@ -220,10 +220,10 @@ class InheritableTreeEntity(TreeEntity): return None def get_path(self, pathsep='/', field='slug'): - path = getattr(self.instance, field, '?') + path = getattr(self.instance, field, getattr(self.instance, 'slug', '?')) parent = self.parent while parent: - path = getattr(parent.instance, field, '?') + pathsep + path + path = getattr(parent.instance, field, getattr(parent.instance, 'slug', '?')) + pathsep + path parent = parent.parent return path path = property(get_path) -- 2.20.1