@bp.route('/resource/<doc_type>', methods=['GET'])
def get(doc_type):
    data = db.get_list(doc_type)
    if ('application/json' in request.headers.get('accept')):
        response = json.dumps(list_as_json(data))
        return Response(response, mimetype='application/json')
    return render_template('list.html', items=data, doc_type=doc_type, fields=FORM_SCHEMA[doc_type], get_options=db.get_list)
@bp.route('/resource/<doc_type>', methods=['GET'])
def get(doc_type):
    data = db.get_list(doc_type)
    if ('application/json' in request.headers.get('accept')):
        response = json.dumps(list_as_json(data))
        return Response(response, mimetype='application/json')
    return render_template('list.html', items=data, doc_type=doc_type, fields=FORM_SCHEMA[doc_type], get_options=db.get_list)