def json2list(jsonstr):

    if jsonstr == "":
        value_list = []
    else:
        if jsonstr[0] == "[":
            value_list = json2py(jsonstr)
        else:
            value_list = jsonstr.split(",")
        if not isinstance(value_list, list):
            value_list = [value_list]
    return value_list

# -----------------------------------------------------------------------------
Used to modify a json string to a python list.
dataset/ETHPy150Open sahana/eden/modules/s3db/survey.py/json2list