|Version 4 (modified by 14 years ago) ( diff ),|
This can be done by simply calling the RESTlike controller with the var
/sahana/module/resource?format=json # Lists all records of this resource /sahana/module/resource/id?format=json # Display record with record.id==id /sahana/module/resource/create?format=json # ToDo /sahana/module/resource/update/id?format=json # ToDo
The underlying functions are very easy within Web2Py since 1.55:
def display_json(): "Designed to be called via AJAX to be processed within JS client." list=db(db.table.id==t2.id).select(db.table.ALL).json() response.view='plain.html' return dict(item=list)
Note: See TracWiki for help on using the wiki.