parameters: (self, node)
docstring: Add the relation tag which link a person to an organisation
docstring_summary: Add the relation tag which link a person to an organisation
docstring_tokens: Add the relation tag which link a person to an organisation
function: def _setRelation(self, node):
      """
      Add the relation tag which link a person to an organisation
      """
      if self.object_type == "Person":
        if getattr(self, "relation", None) is not None:
          # this must be the gid of organisatin
          # we suppose here that we get the id in self.relation
          # in other cases, this method must be overriden
          tiosafe_sync_list = self.getTioSafeSynchronizationObjectList(object_type='Organisation')
          for tiosafe_sync in tiosafe_sync_list:
            try:
              brain_node = tiosafe_sync.getObjectFromId(self.relation)
              organisation_gid = brain_node.getGid()
              break
            except (ValueError, AttributeError):
              organisation_gid = None
  
          if organisation_gid is None:
            raise ValueError("Impossible to find organisation for id %s on node %s" %(self.relation, self.path))
        else:
          organisation_gid = ""
        # set the tag
        if organisation_gid:
          element = etree.SubElement(node, 'relation')
          element.text = organisation_gid
function_tokens: def _setRelation ( self , node ) : if self . object_type == "Person" : if getattr ( self , "relation" , None ) is not None : # this must be the gid of organisatin # we suppose here that we get the id in self.relation # in other cases, this method must be overriden tiosafe_sync_list = self . getTioSafeSynchronizationObjectList ( object_type = 'Organisation' ) for tiosafe_sync in tiosafe_sync_list : try : brain_node = tiosafe_sync . getObjectFromId ( self . relation ) organisation_gid = brain_node . getGid ( ) break except ( ValueError , AttributeError ) : organisation_gid = None if organisation_gid is None : raise ValueError ( "Impossible to find organisation for id %s on node %s" % ( self . relation , self . path ) ) else : organisation_gid = "" # set the tag if organisation_gid : element = etree . SubElement ( node , 'relation' ) element . text = organisation_gid