Exemplo n.º 1
0
def search(page=1):
    q = request.args['keyword'].split('/page')[0]
    ids = Posts.search_keyword(q)
    print ids
    if ids:
        mess = Posts.search_news_by_page(page,ids)
        pageCount = Posts.get_per_count(len(ids))
        pageurl = "/search?keyword="+q+"/page="
        return render_template('Home/index.html', msgs=mess, currentPage=page, pageCount=pageCount,pageurl=pageurl)
    else:
        id = 0
        mess = Posts.get_a_post(id)
        pageurl = "/search?keyword="+q+"/page="
        return render_template('Home/index.html', msgs=mess, currentPage=1, pageCount=1,pageurl=pageurl)
Exemplo n.º 2
0
def paper(y, m, k):
    mess = Posts.get_a_post(k)
    return render_template('Paper/index.html',mess=mess)