def history(): query = qb.from_params(request.args) history = Alert.get_history(query) if history: return jsonify(status="ok", history=[h.serialize for h in history], total=len(history)) else: return jsonify(status="ok", message="not found", history=[], total=0)
def history(): query = qb.from_params(request.args, customers=g.customers) paging = Page.from_params(request.args, items=0) history = Alert.get_history(query, paging.page, paging.page_size) if history: return jsonify(status='ok', history=[h.serialize for h in history], total=len(history)) else: return jsonify(status='ok', message='not found', history=[], total=0)
def history(): query = qb.from_params(request.args) history = Alert.get_history(query) if history: return jsonify( status="ok", history=[h.serialize for h in history], total=len(history) ) else: return jsonify( status="ok", message="not found", history=[], total=0 )