Ignore:
Timestamp:
02/08/12 11:49:42 (9 years ago)
Author:
mnagni
Message:

Complete - # 22428: CEDA Project - observationCollection
 http://team.ceda.ac.uk/trac/ceda/ticket/22428

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/dataEntity.py

    r8460 r8481  
    207207        deProcessor.assignDOI(ceda_observation, doi) 
    208208 
     209    def _assignObservationCollectionToProject(self, obsColl, ceda_observation): 
     210        if ceda_observation.inSupportOf is None: 
     211            return 
     212         
     213        for proj_coll in ceda_observation.inSupportOf.observationCollection: 
     214            if proj_coll.id == obsColl.id: 
     215                return 
     216         
     217        ceda_observation.inSupportOf.observationCollection.append(obsColl) 
     218 
    209219    def _processDeploymentMigration(self, deploymentMigration, single_deployment):                                       
    210220        deProcessor = DeploymentProcessor(self._dataEntityMigration, deploymentMigration, self.epbRepo) 
     
    256266                if not self.epbRepo.moles3EPB.observationCollectionHasObservation(getattr(obsColl, 'id'), getattr(ceda_observation, 'id')): 
    257267                    self.epbRepo.moles3EPB.updateCedaObject(obsColl, {'member': ceda_observation}) 
    258                                        
     268                 
     269                self._assignObservationCollectionToProject(obsColl, ceda_observation)                     
    259270            except Exception as ex: 
    260271                self._report.append(ex)                 
Note: See TracChangeset for help on using the changeset viewer.