# HG changeset patch # User Sylvain Thénault <sylvain.thenault@logilab.fr> # Date 1249075574 -7200 # Node ID 92aad5e184051919ec2a14aebafa98dcc38f9704 # Parent 16d9419a4a791071f11e8e1f2c745ad07276ad10 [R schemaobjs] property accessors for CWRelation/CWAttribute diff -r 16d9419a4a79 -r 92aad5e18405 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'