Changeset 8502


Ignore:
Timestamp:
09/08/12 14:55:29 (7 years ago)
Author:
mnagni
Message:

Incomplete - # 22534: Add versiojn number to the gui page
 http://team.ceda.ac.uk/trac/ceda/ticket/22534
SearchByKeyword?, returns a dictionary of objects where the key is the GUID of the object in the value

File:
1 edited

Legend:

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

    r8501 r8502  
    258258            Loooks for CEDA_Observation containing a specific title (observation.identifier.code) 
    259259            @param keywords: a space separated terms string 
    260             @return: a tuple containing a CEDA_Observation satisfying the queryllection.idenfitier element having the titl 
     260            @returns: dictionary where the keys are the GUID of the CEDA_Observation in the valu 
    261261        """                 
    262262        # search_vector is a ts_vector column. To search for terms, you use the  
     
    270270        # should always be put into queries this way to prevent SQL injection. 
    271271        q = q.params(terms=keywords) 
    272         return q.all() 
     272         
     273        ret = {} 
     274        for item in q.all(): 
     275            guid = self.retrieveGUIDFromInstance(item) 
     276            if guid is not None: 
     277                ret[guid.id] = item             
     278        return ret 
     279        return  
    273280 
    274281 
Note: See TracChangeset for help on using the changeset viewer.