Ejemplo n.º 1
0
 def save_authorship(self, row_num, man):
     """ Saves authorship information """
     authors = ''
     auth = Authorship()
     found = auth.get_authors(man.uuid,
                              man.project_uuid)
     if found:
         # save counts of different dc-terms:creator for use as table metadata
         for auth_id in auth.creators:
             if auth_id not in self.dc_creator_ids:
                 self.dc_creator_ids[auth_id] = 0
             self.dc_creator_ids[auth_id] += 1
         # save counts of different dc-terms:contributor for use as table metadata    
         for auth_id in auth.contributors:
             if auth_id not in self.dc_contributor_ids:
                 self.dc_contributor_ids[auth_id] = 0
             self.dc_contributor_ids[auth_id] += 1    
         all_author_ids = auth.creators + auth.contributors
         all_authors = []
         for auth_id in all_author_ids:
             author = self.deref_entity_label(auth_id)
             all_authors.append(author)
         authors = '; '.join(all_authors)
     # save Authors
     cell = ExpCell()
     cell.table_id = self.table_id
     cell.uuid = man.uuid
     cell.project_uuid = man.project_uuid
     cell.row_num = row_num
     cell.field_num = 7
     cell.record = authors
     cell.save()
     cell = None
Ejemplo n.º 2
0
 def save_authorship(self, row_num, man):
     """ Saves authorship information """
     authors = ''
     auth = Authorship()
     found = auth.get_authors(man.uuid, man.project_uuid)
     if found:
         # save counts of different dc-terms:creator for use as table metadata
         for auth_id in auth.creators:
             if auth_id not in self.dc_creator_ids:
                 self.dc_creator_ids[auth_id] = 0
             self.dc_creator_ids[auth_id] += 1
         # save counts of different dc-terms:contributor for use as table metadata
         for auth_id in auth.contributors:
             if auth_id not in self.dc_contributor_ids:
                 self.dc_contributor_ids[auth_id] = 0
             self.dc_contributor_ids[auth_id] += 1
         all_author_ids = auth.creators + auth.contributors
         all_authors = []
         for auth_id in all_author_ids:
             author = self.deref_entity_label(auth_id)
             all_authors.append(author)
         authors = '; '.join(all_authors)
     # save Authors
     cell = ExpCell()
     cell.table_id = self.table_id
     cell.uuid = man.uuid
     cell.project_uuid = man.project_uuid
     cell.row_num = row_num
     cell.field_num = 7
     cell.record = authors
     cell.save()
     cell = None