[R schemaobjs] property accessors for CWRelation/CWAttribute
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 31 Jul 2009 23:26:14 +0200
changeset 2594 92aad5e18405
parent 2593 16d9419a4a79
child 2595 e76bf303c6f2
[R schemaobjs] property accessors for CWRelation/CWAttribute
entities/schemaobjs.py
--- a/entities/schemaobjs.py	Fri Jul 31 23:25:02 2009 +0200
+++ b/entities/schemaobjs.py	Fri Jul 31 23:26:14 2009 +0200
@@ -112,6 +112,18 @@
             return self.relation_type[0].rest_path(), {}
         return super(CWRelation, self).after_deletion_path()
 
+    @property
+    def rtype(self):
+        return self.relation_type[0]
+
+    @property
+    def stype(self):
+        return self.from_entity[0]
+
+    @property
+    def otype(self):
+        return self.to_entity[0]
+
 
 class CWAttribute(CWRelation):
     id = 'CWAttribute'