.id backward compat
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 08 Dec 2009 09:09:07 +0100
changeset 4013 f0d1038e5059
parent 4012 f6c65e04704c
child 4014 24f7d7eb4c23
.id backward compat
appobject.py
vregistry.py
--- a/appobject.py	Tue Dec 08 08:46:15 2009 +0100
+++ b/appobject.py	Tue Dec 08 09:09:07 2009 +0100
@@ -310,6 +310,11 @@
     # deprecated ###############################################################
 
     @property
+    @deprecated('[3.6] use self.__regid__')
+    def id(self):
+        return self.__regid__
+
+    @property
     @deprecated('[3.6] use self._cw.vreg')
     def vreg(self):
         return self._cw.vreg
--- a/vregistry.py	Tue Dec 08 08:46:15 2009 +0100
+++ b/vregistry.py	Tue Dec 08 09:09:07 2009 +0100
@@ -64,7 +64,7 @@
         warn('[3.6] %s.%s: id is deprecated, use __regid__'
              % (cls.__module__, cls.__name__), DeprecationWarning)
         cls.__regid__ = cls.id
-    if hasattr(cls, 'id'):
+    if hasattr(cls, 'id') and not isinstance(cls.id, property):
         return cls.id
     return cls.__regid__