Changeset 8264 for mauRepo


Ignore:
Timestamp:
19/04/12 17:10:55 (8 years ago)
Author:
mnagni
Message:

GUID out in the page

Location:
mauRepo/MolesManager/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/src/MolesManager/moles3epb.py

    r8250 r8264  
    8585        #Moles3EPB._closeSession(session)  
    8686 
     87    @classmethod 
     88    def retrieveGUIDFromInstance(self, instance, session = None): 
     89        """ 
     90            Returns the CedaGUID object associated with the given instance. 
     91            @param instance: an instance of CEDA_Observation os CEDA_ObservationCollection   
     92        """ 
     93        intSession = Moles3EPB._getSession(session) 
     94        if instance is None: 
     95            return None 
     96        if type(instance) == CEDA_ObservationCollection: 
     97            return intSession.query(CedaGUID).filter(CedaGUID.ceda_observationcollection==instance.id).first() 
     98        elif type(instance) == CEDA_Observation: 
     99            return intSession.query(CedaGUID).filter(CedaGUID.ceda_observation==instance.id).first() 
     100             
    87101     
    88102    @classmethod 
  • mauRepo/MolesManager/trunk/src/MolesManager/static/templates/base.html

    r8261 r8264  
    7777 
    7878                                        <input type="hidden" name="coObs" id="coObs_id" value='{{ coObs }}' /> 
     79                                        <input type="hidden" name="guid" id="guid_id" value='{{ guid }}' /> 
    7980 
    8081                                        <div 
  • mauRepo/MolesManager/trunk/src/MolesManager/views/cedaObservationView.py

    r8239 r8264  
    3232    if record: 
    3333        c['coObs'] = mark_safe(DJEncoder().escapeForJSON(DJEncoder().encode(record))) 
     34        guid = Moles3EPB.retrieveGUIDFromInstance(record, request.moles_session) 
     35        if guid: 
     36            c['guid'] = guid.id 
     37            print c['guid'] 
    3438        print c['coObs']  
    3539     
  • mauRepo/MolesManager/trunk/src/libs/migration/processor/dataEntity.py

    r8258 r8264  
    131131             
    132132            deProcessor.assignDOI(ceda_observation, doi) 
     133            if doi: 
     134                DataEntityProcessor.log.info("DOI: %s for " % (doi['href'][4:])) 
     135                DataEntityProcessor.log.info("  -deployment: %s" % (migrationObjectDescription(deploymentMigration))) 
     136                DataEntityProcessor.log.info("  -dataEntity: %s" % (migrationObjectDescription(self._dataEntityMigration))) 
    133137            self.migrationSessions.molesSession.commit() 
    134138        except NoAssociatedAuthor as ex: 
Note: See TracChangeset for help on using the changeset viewer.