entity.py
branchstable
changeset 6419 6aa0bb1c42e2
parent 6317 0d4dd5f6f05c
child 6425 8d7c2fd2ac66
equal deleted inserted replaced
6414:6003dc203567 6419:6aa0bb1c42e2
  1154         self._rtype = rschema.type
  1154         self._rtype = rschema.type
  1155         self._role = role
  1155         self._role = role
  1156 
  1156 
  1157     def __get__(self, eobj, eclass):
  1157     def __get__(self, eobj, eclass):
  1158         if eobj is None:
  1158         if eobj is None:
  1159             raise AttributeError('%s cannot be only be accessed from instances'
  1159             raise AttributeError('%s can only be accessed from instances'
  1160                                  % self._rtype)
  1160                                  % self._rtype)
  1161         return eobj.related(self._rtype, self._role, entities=True)
  1161         return eobj.related(self._rtype, self._role, entities=True)
  1162 
  1162 
  1163     def __set__(self, eobj, value):
  1163     def __set__(self, eobj, value):
  1164         raise NotImplementedError
  1164         raise NotImplementedError