Esempio n. 1
0
def ajax_institutions_experiments():
    """Datatable handler to get experiments in an institution."""
    recid = request.args.get('recid', '')

    pid = PersistentIdentifier.get('institutions', recid)

    record = InstitutionsSearch().get_source(pid.object_uuid)
    try:
        icn = record.get('ICN', [])[0]
    except KeyError:
        icn = ''

    hits = get_institution_experiments_from_es(icn)
    return jsonify({
        "data": get_institution_experiments_datatables_rows(hits),
        "total": hits.total
    })
Esempio n. 2
0
def ajax_institutions_experiments():
    """Datatable handler to get experiments in an institution."""
    recid = request.args.get('recid', '')

    pid = PersistentIdentifier.get('institutions', recid)

    record = InstitutionsSearch().get_source(pid.object_uuid)
    try:
        icn = record.get('ICN', [])[0]
    except KeyError:
        icn = ''

    hits = get_institution_experiments_from_es(icn)
    return jsonify(
        {
            "data": get_institution_experiments_datatables_rows(hits),
            "total": hits.total
        }
    )