def add_location(self, location_json): """ link user to location nodes :param locations_place_id: :return: """ #TODO exception handling #TODO do in location and pass in the node from the actual object (better pattern) location_place_id = location_json['id'] location = Location() location.id = location_place_id location_node = location.location_node_by_place_id if not location_node: location.set_location_properties(location_json) location.create_location() location_node = location.location_node_by_place_id() user_location_relationship = Relationship(self.user_node, GraphRelationship.LOCATED_IN, location_node) # try: self._graph_db.create_unique(user_location_relationship)