entities/__init__.py
changeset 8899 c7a95ebcc093
parent 8748 f5027f8d2478
child 8930 6a02be304486
--- a/entities/__init__.py	Tue Apr 23 12:38:27 2013 +0200
+++ b/entities/__init__.py	Tue Apr 23 15:16:36 2013 +0200
@@ -22,7 +22,7 @@
 from warnings import warn
 
 from logilab.common.deprecation import deprecated
-from logilab.common.decorators import cached
+from logilab.common.decorators import cached, classproperty
 
 from cubicweb import Unauthorized
 from cubicweb.entity import Entity
@@ -60,6 +60,11 @@
 
     # meta data api ###########################################################
 
+    @classproperty
+    def cw_etype(self):
+        """entity Etype as a string"""
+        return self.__regid__
+
     def dc_title(self):
         """return a suitable *unicode* title for this entity"""
         for rschema, attrschema in self.e_schema.attribute_definitions():