def do_jsonreports_search(request):
    try:
        model = models.JsonReport
        filters = _create_query_filters(request)
        reports = model_search(request, model.objects, filters,
                               order_by='-id')
        results = [['Id', 'Start', 'End', 'Created', 'Name', 'Version']]
        for report in reports:
                results.append([report.id,
                                datetime.datetime.strftime(
                                    report.period_start, UTC_FORMAT),
                                datetime.datetime.strftime(
                                    report.period_end, UTC_FORMAT),
                                datetime.datetime.strftime(
                                    dt.dt_from_decimal(report.created),
                                    UTC_FORMAT),
                                report.name,
                                report.version])
    except BadRequestException as be:
        return error_response(400, 'Bad Request', str(be))
    except __HOLE__ as ve:
        return error_response(400, 'Bad Request', ve.messages[0])

    return rsp(json.dumps(results))
dataset/ETHPy150Open openstack/stacktach/stacktach/stacky_server.py/do_jsonreports_search