def hpoterms(): """Search for HPO terms.""" query = request.args.get('query') if query is None: return abort(500) terms = store.hpo_terms(query=query).limit(8) json_terms = [{'name': '{} | {}'.format(term['_id'], term['description']), 'id': term['_id']} for term in terms] return jsonify(json_terms)
def hpoterms(): """Search for HPO terms.""" query = request.args.get("query") if query is None: return abort(500) terms = sorted(store.hpo_terms(query=query), key=itemgetter("hpo_number")) json_terms = [{ "name": "{} | {}".format(term["_id"], term["description"]), "id": term["_id"] } for term in terms[:7]] return jsonify(json_terms)
def hpoterms(): """Search for HPO terms.""" query = request.args.get('query') if query is None: return abort(500) terms = sorted(store.hpo_terms(query=query), key=itemgetter('hpo_number')) json_terms = [{ 'name': '{} | {}'.format(term['_id'], term['description']), 'id': term['_id'] } for term in terms[:7]] return jsonify(json_terms)
def hpoterms(): """Search for HPO terms.""" query = request.args.get('query') if query is None: return abort(500) terms = sorted(store.hpo_terms(query=query), key=itemgetter('hpo_number')) json_terms = [ {'name': '{} | {}'.format(term['_id'], term['description']), 'id': term['_id'] } for term in terms[:7]] return jsonify(json_terms)