def classify(type, page): start = (page - 1) * 5 # 计算某一页需要跳过的文章数目 article = Article() result = article.find_by_type(type, start, 5) # 某一页的文章详情 total = math.ceil(article.get_count_by_type(type) / 5) # 统计页数 return render_template('type.html', result=result, page=page, total=total, type=type)
def classify(type, page): article = Article() start = (page - 1) * 10 result = article.find_by_type(type, start, 10) total = math.ceil(article.get_count_by_type(type) / 10) return render_template('type.html', result=result, type=type, page=page, total=total)
def classify(type, page): start = (page - 1) * 10 article = Article() result = article.find_by_type(type, start, 10) total = math.ceil(article.get_count_by_type(type) / 10) last = article.find_last_9() most = article.find_most_9() return render_template('type.html', result=result, page=page, total=total, type=type, last=last, most=most)