summaryrefslogtreecommitdiffstats
path: root/ipalib/base.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-07-20 18:55:53 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-07-20 18:55:53 +0000
commitf3faaf2d29e57733a4d1c2a05534add46d6491bc (patch)
treec2e68200793d47e558ac45eb428fb6f9d0b9aa54 /ipalib/base.py
parent97a3520d3737d10717956ad6fff1e558e7261a2d (diff)
downloadfreeipa-f3faaf2d29e57733a4d1c2a05534add46d6491bc.zip
freeipa-f3faaf2d29e57733a4d1c2a05534add46d6491bc.tar.gz
freeipa-f3faaf2d29e57733a4d1c2a05534add46d6491bc.tar.xz
22: Named.name property now calls _get_name() at first evaluation to make changing the behaviour in subclasses easier
Diffstat (limited to 'ipalib/base.py')
-rw-r--r--ipalib/base.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ipalib/base.py b/ipalib/base.py
index 3c30236..09355f4 100644
--- a/ipalib/base.py
+++ b/ipalib/base.py
@@ -129,8 +129,15 @@ class NameSpace(object):
class Named(object):
- def __get_name(self):
+ __name = None
+
+ def _get_name(self):
return self.__class__.__name__
+
+ def __get_name(self):
+ if self.__name is None:
+ self.__name = self._get_name()
+ return self.__name
name = property(__get_name)