def report(id): r = reports.find_by_id(id) if not r: abort(404) recent_reports = reports.recent() return render_template('report.html', report=r, recent_reports=recent_reports)
def report_list(page=1): modelpage = max(0, page - 1) rs = reports.find_reports_on_page(modelpage) pages = reports.count_pages() if page > pages: abort(404) begin, end = pagination(page, pages) recent_reports = reports.recent() return render_template('reports.html', page=page, pages=pages, reports=rs, begin=begin, end=end, recent_reports=recent_reports)