@@ -514,7 +514,7 @@ def getAffiliations(self, ids=None, personfirst=None, personlast=None, orgcode=N
514514 Results
515515 """
516516
517- def getResults (self , ids = None , type = None , uuids = None , actionid = None , simulationid = None , sfid = None , variableid = None ):
517+ def getResults (self , ids = None , type = None , uuids = None , actionid = None , simulationid = None , sfid = None , variableid = None ):
518518
519519 # TODO what if user sends in both type and actionid vs just actionid
520520 """
@@ -529,16 +529,18 @@ def getResults(self, ids=None, type= None, uuids= None, actionid=None, simulatio
529529
530530 query = self ._session .query (Results )
531531
532- if actionid : query = query .join (FeatureActions ).filter_by (ActionID = actionid )
533- if type : query = query .filter_by (ResultTypeCV = type )
532+
533+ if type : query = query .filter_by (ResultTypeCV = type )
534+ if variableid : query = query .filter_by (VariableID = variableid )
535+ if ids : query = query .filter (Results .ResultID .in_ (ids ))
536+ if uuids : query = query .filter (Results .ResultUUID .in_ (uuids ))
534537 if simulationid : query = query .join (FeatureActions )\
535538 .join (Actions )\
536539 .join (Simulations )\
537540 .filter_by (SimulationID = simulationid )
538- if ids : query = query .filter (Results .ResultID .in_ (ids ))
539- if uuids : query = query .filter (Results .ResultUUID .in_ (uuids ))
541+ if actionid : query = query .join (FeatureActions ).filter_by (ActionID = actionid )
540542 if sfid : query = query .join (FeatureActions ).filter_by (SamplingFeatureID = sfid )
541- if variableid : query = query . filter_by ( VariableID = variableid )
543+
542544
543545 try :
544546 return query .all ()
0 commit comments