Beispiel #1
0
 def make_table_dc_creator_list(self, proj_uuid_counts):
     """ makes a list of dublin core creators
         from a project uuid + counts list """
     dc_creators = []
     for proj_uuid_count in proj_uuid_counts:
         project_uuid = proj_uuid_count['project_uuid']
         proj_count = proj_uuid_count['num_uuids']
         auth = Authorship()
         auth.get_project_authors(project_uuid)
         if len(auth.creators) < 1 and \
            len(auth.contributors) > 0:
             auth.creators = auth.contributors
         if len(auth.creators) > 0:
             for auth_uuid in auth.creators:
                 auth_man = False
                 try:
                     auth_man = Manifest.objects.get(uuid=auth_uuid)
                 except Manifest.DoesNotExist:
                     auth_man = False
                 if auth_man is not False:
                     i = len(dc_creators) + 1
                     item = LastUpdatedOrderedDict()
                     item['id'] = URImanagement.make_oc_uri(auth_uuid, 'persons')
                     item['count'] = proj_count
                     dc_creators.append(item)
     return dc_creators
Beispiel #2
0
 def make_table_dc_creator_list(self, proj_uuid_counts):
     """ makes a list of dublin core creators
         from a project uuid + counts list """
     dc_creators = []
     for proj_uuid_count in proj_uuid_counts:
         project_uuid = proj_uuid_count['project_uuid']
         proj_count = proj_uuid_count['num_uuids']
         auth = Authorship()
         auth.get_project_authors(project_uuid)
         if len(auth.creators) < 1 and \
            len(auth.contributors) > 0:
             auth.creators = auth.contributors
         if len(auth.creators) > 0:
             for auth_uuid in auth.creators:
                 auth_man = False
                 try:
                     auth_man = Manifest.objects.get(uuid=auth_uuid)
                 except Manifest.DoesNotExist:
                     auth_man = False
                 if auth_man is not False:
                     i = len(dc_creators) + 1
                     item = LastUpdatedOrderedDict()
                     item['id'] = URImanagement.make_oc_uri(
                         auth_uuid, 'persons')
                     item['count'] = proj_count
                     dc_creators.append(item)
     return dc_creators