def query_devices(): return {"actions": Device.all_to_api(request.json)}
def get_devices(): query = {} for k in request.params.keys(): query[k] = request.params.get(k) return {"devices": Device.all_to_api(query)}