コード例 #1
0
def index(page):
    skip = (page - 1) * int(app.config['PER_PAGE'])
    posts = postClass.get_posts(int(app.config['PER_PAGE']), skip)
    for data in posts['data']:
        Post._filter(data)
    count = postClass.get_total_count()
    pag = pagination.Pagination(page, app.config['PER_PAGE'], count)
    return render_template('index.html',
                           posts=posts['data'],
                           pagination=pag,
                           meta_title=app.config['BLOG_TITLE'])
コード例 #2
0
def post_preview():
    post = session.get('post-preview')
    post = Post._filter(post)
    return render_template('preview.html',
                           post=post,
                           meta_title='Preview post::' + post['title'])