def dashboard(): pagination = Pagination(request) filter_form = ProblemFilterForm(request.args) if filter_form.validate(): if request_wants_json(): p = get_problems(filter_form, pagination) else: list_table_rows, problem_count = \ problems_list_table_rows_cache(filter_form, pagination) return render_template("problems/list.html", list_table_rows=list_table_rows, problem_count=problem_count, filter_form=filter_form, pagination=pagination) else: p = [] if request_wants_json(): return jsonify(dict(problems=p)) return render_template("problems/list.html", problems=p, problem_count=len(p), filter_form=filter_form, pagination=pagination)
def dashboard(): pagination = Pagination(request) filter_form = ReportFilterForm(request.args) if filter_form.validate(): if request_wants_json(): r = get_reports(filter_form, pagination) else: list_table_rows, report_count = \ reports_list_table_rows_cache(filter_form, pagination) return render_template("reports/list.html", list_table_rows=list_table_rows, report_count=report_count, filter_form=filter_form, pagination=pagination) else: r = [] if request_wants_json(): return jsonify(dict(reports=r)) return render_template("reports/list.html", reports=r, report_count=len(r), filter_form=filter_form, pagination=pagination)
def results_list() -> str: pagination = Pagination(request) trs = (db.session.query(TaskResult).order_by( TaskResult.finished_time.desc())) if request.args.get("unsuccessful_only", "") == "true": trs = trs.filter(TaskResult.state != "SUCCESS") if pagination.limit > 0: trs = trs.limit(pagination.limit) if pagination.offset >= 0: trs = trs.offset(pagination.offset) return render_template("celery_tasks/results_list.html", task_results=trs.all(), pagination=pagination)