I'm trying to create multiple relationship from the same nodes, in my case, my user needs to be able to comment more than one time in my Post. I did that by creating an relationship between User and Post. But when I try to create it, it actually updates the old relationship. Have I done anything wrong? Is there an better way to do this?
graph.schema.create_uniqueness_constraint('COMMENTS', 'uuid')
def comment(self, post_uuid, comment):
post = self.graph.find_one('Post','uuid', post_uuid)
user = self.graph.find_one('User','uuid', self.uuid)
r_comment = Relationship(user, "COMMENTS", post, comment=comment, uuid=uuid4().hex, date=str(datetime.utcnow()))
self.graph.create(r_comment)
return True