How to return value from Python as JSON?
Encode it using the functions in the json
module.
return json.dumps(return_info)
main problem is
return_info = [record.file_id, record.filename, record.links_to]
because JSON format is generally like
Example:
json.dumps({'file_id': record.file_id, 'filename': record.filename , 'links_to' : record.links_to})
and the message you are going to receive is [object Object]
if you use alert(data)
So use alert(data.file_id);
if you use the example