scout/adapter/mongo/case.py
def case(self, case_id=None, institute_id=None, display_name=None):
        """Fetches a single case from database

        Use either the _id or combination of institute_id and display_name

        Args:
            case_id(str): _id for a caes
            institute_id(str):
            display_name(str)

        Yields:
            A single Case
        """
        query = {}
        if case_id:
            query['_id'] = case_id
            LOG.info("Fetching case %s", case_id)
        else:
            if not (institute_id and display_name):
                raise ValueError("Have to provide both institute_id and display_name")
            LOG.info("Fetching case %s institute %s", display_name, institute_id)
            query['owner'] = institute_id
            query['display_name'] = display_name

        return self.case_collection.find_one(query)
def case(self, case_id=None, institute_id=None, display_name=None):
        query = {}
        if case_id:
            query['_id'] = case_id
            LOG.info("Fetching case %s", case_id)
        else:
            if not (institute_id and display_name):
                raise ValueError("Have to provide both institute_id and display_name")
            LOG.info("Fetching case %s institute %s", display_name, institute_id)
            query['owner'] = institute_id
            query['display_name'] = display_name

        return self.case_collection.find_one(query)
def case ( self , case_id = None , institute_id = None , display_name = None ) : query = { } if case_id : query [ '_id' ] = case_id LOG . info ( "Fetching case %s" , case_id ) else : if not ( institute_id and display_name ) : raise ValueError ( "Have to provide both institute_id and display_name" ) LOG . info ( "Fetching case %s institute %s" , display_name , institute_id ) query [ 'owner' ] = institute_id query [ 'display_name' ] = display_name return self . case_collection . find_one ( query )
Fetches a single case from database

        Use either the _id or combination of institute_id and display_name

        Args:
            case_id(str): _id for a caes
            institute_id(str):
            display_name(str)

        Yields:
            A single Case
Fetches a single case from database