X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/2a1082fb32ede39a2bd39a3de243adc882a72b83..1c81f61d4e574d439ed2dbfefd599f04b5e2bef9:/models/base.py diff --git a/models/base.py b/models/base.py index 3bcf394..a178a95 100644 --- a/models/base.py +++ b/models/base.py @@ -45,6 +45,9 @@ def register_value_model(model): value_content_type_limiter.register_class(model) +register_value_model(Tag) + + def unregister_value_model(model): value_content_type_limiter.unregister_class(model) @@ -425,12 +428,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):