(doc_id, dbs, find_first=True)
return response, db_results
Look up a document ID

    :param doc_id: ID of document to look for
    :param dbs: list of databases to look in
    :param find_first: Set to False to look in all databases even after a match is found.
    :returns: Tuple of (LookupResult or None, list of DbResult objects for each DB searched)
Look up a document ID
Look up a document ID
def lookup_id_in_databases(doc_id, dbs, find_first=True):
    """Look up a document ID

    :param doc_id: ID of document to look for
    :param dbs: list of databases to look in
    :param find_first: Set to False to look in all databases even after a match is found.
    :returns: Tuple of (LookupResult or None, list of DbResult objects for each DB searched)
    """
    STATUSES = defaultdict(lambda: 'warning', {
        'missing': 'default',
        'deleted': 'danger',
    })

    db_results = []
    response = None
    for db in dbs:
        try:
            db_response = db.get_context(doc_id)
            if not response:
                response = db_response
        except ResourceNotFound as e:
            db_results.append(DbResult(db.dbname, str(e), STATUSES[str(e)]))
        else:
            db_results.append(DbResult(db.dbname, 'found', 'success'))
            if find_first:
                break

    return response, db_results
def lookup_id_in_databases ( doc_id , dbs , find_first = True ) : STATUSES = defaultdict ( lambda : 'warning' , { 'missing' : 'default' , 'deleted' : 'danger' , } ) db_results = [ ] response = None for db in dbs : try : db_response = db . get_context ( doc_id ) if not response : response = db_response except ResourceNotFound as e : db_results . append ( DbResult ( db . dbname , str ( e ) , STATUSES [ str ( e ) ] ) ) else : db_results . append ( DbResult ( db . dbname , 'found' , 'success' ) ) if find_first : break return response , db_results