def save_dashboard(): dashboard_obj = request.form.get("dashboard", None) if not dashboard_obj: abort(400) dashboard = Dashboard(request.form.get("id")) dashboard.dashboard = json.loads(dashboard_obj) if dashboard.save(): return jsonify(message=dashboard._id) else: abort(500)
def dashboard_search(term): return jsonify(message=sorted(Dashboard.search(term)))