X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/dff8591e4ad14b7f1026adde11b4a43a36b364a2..15c68a7a08349d807c767cce58fdbeec0dcc192d:/models/base.py diff --git a/models/base.py b/models/base.py index 3bcf394..290e8b8 100644 --- a/models/base.py +++ b/models/base.py @@ -425,12 +425,12 @@ class TreeModel(MPTTModel): if root is not None and not self.is_descendant_of(root): raise AncestorDoesNotExist(root) - qs = self.get_ancestors() + qs = self.get_ancestors(include_self=True) if root is not None: qs = qs.filter(**{'%s__gt' % self._mptt_meta.level_attr: root.get_level()}) - return pathsep.join([getattr(parent, field, '?') for parent in list(qs) + [self]]) + return pathsep.join([getattr(parent, field, '?') for parent in qs]) path = property(get_path) def __unicode__(self):