def convert_to_json_value(column_attrs, attr, value):
    """
    将资源的字段转换成json的格式输出
    :param column_attrs: inspect_.mapper.column_attrs
    :param attr:
    :param value:
    :return:
    """
    from sqlalchemy import Integer, DateTime, Date, Numeric, JSON
    try:
        type_ins = column_attrs[attr].columns[0].type
        if isinstance(type_ins, DateTime):
            return value.strftime('%Y-%m-%d %H:%M:%S')
        elif isinstance(type_ins, Date):
            return str(value)
        elif isinstance(type_ins, Numeric):
            return value
        elif isinstance(type_ins, JSON):
            return value
    except:
        pass
    return value
