From 0106b6fe612f2cac37b12fe8a83af251de3f4d8a Mon Sep 17 00:00:00 2001 From: benjaoming Date: Sun, 3 Feb 2013 16:15:21 +0100 Subject: [PATCH] python 2.5 support --- wiki/models/urlpath.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wiki/models/urlpath.py b/wiki/models/urlpath.py index 27703cb7..51824f92 100644 --- a/wiki/models/urlpath.py +++ b/wiki/models/urlpath.py @@ -52,8 +52,7 @@ class URLPath(MPTTModel): #self._tree_manager = URLPath.objects return super(URLPath, self).__init__(*args, **kwargs) - @property - def cached_ancestors(self): + def __cached_ancestors(self): """ This returns the ancestors of this urlpath. These ancestors are hopefully cached from the article path lookup. Accessing a foreign key included in @@ -70,10 +69,13 @@ class URLPath(MPTTModel): return self._cached_ancestors - @cached_ancestors.setter - def cached_ancestors(self, ancestors): + def __cached_ancestors_setter(self, ancestors): self._cached_ancestors = ancestors - + + # Python 2.5 compatible property constructor + cached_ancestors = property(__cached_ancestors, + __cached_ancestors_setter) + def set_cached_ancestors_from_parent(self, parent): self.cached_ancestors = parent.cached_ancestors + [parent] -- 2.45.2