Example #1
0
def paginate(page):
    page = int(page)
    article = Article()
    result = article.find_with_all((page - 1) * 10, 10)
    total = math.ceil(article.get_total_count() / 10)
    last = article.find_last_9()
    most = article.find_most_9()
    content = render_template('index.html',
                              result=result,
                              page=page,
                              total=total,
                              last=last,
                              most=most)
    return content
Example #2
0
def home():

    article = Article()
    result = article.find_with_all(0, 10)
    last = article.find_last_9()
    most = article.find_most_9()
    total = math.ceil(article.get_total_count() / 10)
    content = render_template('index.html',
                              result=result,
                              page=1,
                              total=total,
                              last=last,
                              most=most)
    return content