X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/dfbf63d1222f34b74ecbcdd301450abed416fe78..36f395364e4467720c550c829d1bfec2e9da5d5f:/models.py diff --git a/models.py b/models.py index 0063c86..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) @@ -295,9 +295,6 @@ class File(Node): response = HttpResponse(wrapper, content_type=self.mimetype) response['Content-Length'] = self.file.size return response - - def __unicode__(self): - return self.file class Template(TreeModel):