def set_contacts(self, profiles): """ *profiles* -- registration.models.Userprofile objects. """ me = self.get_node() batch = WriteBatch(graph_db) for profile in profiles: batch.get_or_create_relationship(me, self.contact_relationship, profile.__node__) r = batch.submit() logger.warn(r)