X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/093ad8d3312e2ba27730f8f5c915ca113ce72041..e96369a63407b44b8e363b057194a89dc4c5fd69:/philo/models/base.py diff --git a/philo/models/base.py b/philo/models/base.py index 86569b7..2f798ae 100644 --- a/philo/models/base.py +++ b/philo/models/base.py @@ -319,7 +319,12 @@ class Entity(models.Model): """ return mapper(self) - attributes = property(get_attribute_mapper) + + @property + def attributes(self): + if not hasattr(self, '_attributes'): + self._attributes = self.get_attribute_mapper() + return self._attributes class Meta: abstract = True @@ -500,7 +505,6 @@ class TreeEntity(Entity, MPTTModel): else: mapper = AttributeMapper return super(TreeEntity, self).get_attribute_mapper(mapper) - attributes = property(get_attribute_mapper) def __unicode__(self): return self.path