Changeset 8350
- Timestamp:
- 14/06/12 17:25:12 (9 years ago)
- Location:
- mauRepo/MolesManager/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
mauRepo/MolesManager/trunk/src/MolesManager/moles3epb.py
r8339 r8350 88 88 def updateCedaObject(self, ceda_object, cols_to_update): 89 89 """ 90 Update and eventually commit a CEDA Object in MOLES3 db. 91 NOTE: only the returned instance will reflect the update! 92 @param ceda_object: the CEDA object to persist 93 @param dict: a dictionary containing the columns to update for the given ceda_object 94 @param session: the external session to use. If None a new session will be open to add and commit the object and then closed at the exit. The object is committed 90 Update and eventually commit a CEDA Object in MOLES3 db. 91 @param ceda_object: the CEDA object to update 92 @param cols_to_update: a dictionary containing the columns to update for the given ceda_object and the desired value. 93 If the attribute is a list of objects the new instances are appended only if do not exist in the actual list 95 94 @return: the given instance with the updated attributes. 96 95 """ … … 110 109 coll_k = getattr(coll, k) 111 110 if type(coll_k) == list or type(coll_k) == InstrumentedList: 112 if type(val) == list or type(val) == InstrumentedList: 113 coll_k.extend(val) 111 tmp_coll = [] 112 if type(val) == list or type(val) == InstrumentedList: 113 tmp_coll.extend(val) 114 114 else: 115 if val in coll_k: 116 break 117 coll_k.append(val) 115 tmp_coll.append(val) 116 for item in tmp_coll: 117 if item not in coll_k: 118 coll_k.append(item) 118 119 else: 119 120 setattr(coll, k, val) 120 EPB.persistInstance(coll, self._session) 121 self._session.commit() 122 return coll 121 123 122 124 def retrieveGUIDFromInstance(self, instance): -
mauRepo/MolesManager/trunk/src/MolesManager/static/templates/cedaSearch.html
r8280 r8350 23 23 <script type="dojo/method" data-dojo-event="onSubmit"> 24 24 if(this.validate()){ 25 return confirm('Form is valid, press OK to submit');25 //return confirm('Form is valid, press OK to submit'); 26 26 }else{ 27 27 alert('Form contains invalid data. Please correct first'); -
mauRepo/MolesManager/trunk/src/libs/migration/processor/dataEntity.py
r8325 r8350 193 193 try: 194 194 ceda_observation = self._processDeploymentMigration(deploymentMigration, howManydm == 1) 195 196 #Check if a doi has been already assigned 197 cedaObservationCollection = EPBRepo.moles3EPB.loadAttributes(cedaObservationCollection, 'member') 198 member = cedaObservationCollection.member 199 if member and not (ceda_observation in member): 200 EPBRepo.moles3EPB.updateCedaObject(cedaObservationCollection, {'member': ceda_observation}) 195 EPBRepo.moles3EPB.updateCedaObject(cedaObservationCollection, {'member': ceda_observation}) 201 196 202 197 except Exception as ex:
Note: See TracChangeset
for help on using the changeset viewer.