Changeset 8295 for mauRepo/MolesManager
- Timestamp:
- 02/05/12 11:54:02 (9 years ago)
- Location:
- mauRepo/MolesManager/trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
mauRepo/MolesManager/trunk/src/MolesManager/moles3epb.py
r8264 r8295 16 16 from sqlalchemy.orm import mapper 17 17 from MolesManager.ceda_guid import CedaGUID 18 from ea_model.moles3_4.utilities.mo_responsiblepartyinfo import MO_ResponsiblePartyInfo 19 from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue 18 20 19 21 … … 110 112 intSession = Moles3EPB._getSession(session) 111 113 return intSession.query(CEDA_ObservationCollection, CEDA_Observation).filter(CEDA_ObservationCollection.id==obs_coll_id).filter(CEDA_Observation.id==obs_id).count() > 0 114 115 @classmethod 116 def observationAuthor(self, obs_id, session = None): 117 """ 118 Lists the CEDA_Observation author. 119 @param obs_id: the CEDA_Observation id 120 @return: True if the collection contains the given observation, False otherwise 121 """ 122 intSession = Moles3EPB._getSession(session) 123 ret = intSession.query(MO_ResponsiblePartyInfo).join(MO_Observation). \ 124 filter(MO_ResponsiblePartyInfo.role == MO_RoleValue.cl_author). \ 125 filter(MO_Observation.id == obs_id) 126 return ret 112 127 113 128 @classmethod -
mauRepo/MolesManager/trunk/src/libs/migration/tests/moles3epbmothods.py
r8254 r8295 15 15 from ea_model.ceda_metadatamodel.ceda_observationcollection.ceda_observationcollection import CEDA_ObservationCollection 16 16 from ea_model.moles3_4.observationcollection.mo_observationcollection import MO_ObservationCollection 17 from ea_model.moles3_4.utilities.mo_responsiblepartyinfo import MO_ResponsiblePartyInfo 18 from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation 19 from ea_model.moles3_4.observation.mo_observation import MO_Observation 20 from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue 17 21 18 22 … … 33 37 34 38 def runTest(self): 35 self.checkExtractCollectionIdentifierByTitle()36 self.checkExtractObservationByTitleKeywords()37 self.checkExtractProjectObservationCollections()39 #self.checkExtractCollectionIdentifierByTitle() 40 #self.checkExtractObservationByTitleKeywords() 41 #self.checkExtractProjectObservationCollections() 38 42 #self.checkExtractObservationCollectionsForObservation() 43 self.checkObservationAuthors() 44 45 def checkObservationAuthors(self): 46 session = Moles3EPB.getNewMolesSession(); 47 coll = Moles3EPB.observationAuthor(1, session) 48 colls = coll.all() 49 print colls 39 50 40 51 def checkExtractObservationCollectionsForObservation(self):
Note: See TracChangeset
for help on using the changeset viewer.