""" This interfaces the reader for a data-transport """ import cms import transport @cms.Plugin(mimetype="application/json",method="POST") def read(**_args) : _request = _args['request'] _body = _request.json _data = {} try: reader = transport.get.reader(label = _body['label']) _query = _body['query'] # # @TODO : # - support for mongodb and NoSQL ... # - limit to 10K _data = reader.apply(_query) _data.to_dict(orient='split') del _data['index'] except Exception as e: print (e) return _data @cms.Plugin(mimetype="application/json") def write(**_args) : _request = _args['request'] print (_request.json) return {}