@check_source<EOL><INDENT>def connect(self, node, properties=None):<DEDENT>
self._check_node(node)<EOL>if not self.definition['<STR_LIT>'] and properties:<EOL><INDENT>raise NotImplementedError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>params = {}<EOL>rel_model = self.definition['<STR_LIT>']<EOL>rp = None  <EOL>if rel_model:<EOL><INDENT>rp = {}<EOL>tmp = rel_model(**properties) if properties else rel_model()<EOL>for p, v in rel_model.deflate(tmp.__properties__).items():<EOL><INDENT>rp[p] = '<STR_LIT:{>' + p + '<STR_LIT:}>'<EOL>params[p] = v<EOL><DEDENT>if hasattr(tmp, '<STR_LIT>'):<EOL><INDENT>tmp.pre_save()<EOL><DEDENT><DEDENT>new_rel = _rel_helper(lhs='<STR_LIT>', rhs='<STR_LIT>', ident='<STR_LIT:r>', relation_properties=rp, **self.definition)<EOL>q = "<STR_LIT>""<STR_LIT>" + new_rel<EOL>params['<STR_LIT>'] = node.id<EOL>if not rel_model:<EOL><INDENT>self.source.cypher(q, params)<EOL>return True<EOL><DEDENT>rel_ = self.source.cypher(q + "<STR_LIT>", params)[<NUM_LIT:0>][<NUM_LIT:0>][<NUM_LIT:0>]<EOL>rel_instance = self._set_start_end_cls(rel_model.inflate(rel_), node)<EOL>if hasattr(rel_instance, '<STR_LIT>'):<EOL><INDENT>rel_instance.post_save()<EOL><DEDENT>return rel_instance<EOL>
Connect a node

:param node:
:param properties: for the new relationship
:type: dict
:return: