def __getattr__(self, attr): type = DynamicRelationshipType.withName(attr) def create_relationship(node): rel = self._element.createRelationshipTo(node._element, type) return Relationship(rel) return create_relationship
def __relationship(self, direction, type): if type: type = DynamicRelationshipType.withName(type) iterator = self._node.getRelationships(direction, type) iterator = iterator.iterator() else: iterator = self._node.getRelationships(direction) iterator = iterator.iterator() return imap(Relationship, iterator)