def relationship(self, node):
        """
        Retrieve the relationship object for this first relationship between self and node.

        :param node:
        :return: StructuredRel
        """
        self._check_node(node)
        my_rel = _rel_helper(lhs='us', rhs='them', ident='r', **self.definition)
        q = "MATCH " + my_rel + " WHERE id(them)={them} and id(us)={self} RETURN r LIMIT 1"
        rels = self.source.cypher(q, {'them': node.id})[0]
        if not rels:
            return

        rel_model = self.definition.get('model') or StructuredRel

        return self._set_start_end_cls(rel_model.inflate(rels[0][0]), node)
def relationship ( self , node ) : self . _check_node ( node ) my_rel = _rel_helper ( lhs = 'us' , rhs = 'them' , ident = 'r' , ** self . definition ) q = "MATCH " + my_rel + " WHERE id(them)={them} and id(us)={self} RETURN r LIMIT 1" rels = self . source . cypher ( q , { 'them' : node . id } ) [ 0 ] if not rels : return rel_model = self . definition . get ( 'model' ) or StructuredRel return self . _set_start_end_cls ( rel_model . inflate ( rels [ 0 ] [ 0 ] ) , node )
Retrieve the relationship object for this first relationship between self and node.

        :param node:
        :return: StructuredRel