views.py 文件源码

python
阅读 40 收藏 0 点赞 0 评论 0

项目:tingsmen 作者: pasqu4le 项目源码 文件源码
def load_more_posts(obj_response, group, name, older_than):
    posts = Post.get_more(group=group, name=name, older_than=older_than)
    render_post = get_template_attribute('macros.html', 'render_post')
    more_posts_panel = get_template_attribute('macros.html', 'more_posts_panel')
    if posts:
        for post in posts:
            obj_response.html_append('#post-container', render_post(post, current_user).unescape())
        obj_response.html('#load_more_container', more_posts_panel(group, name, posts[-1].date).unescape())
        # refresh and re-enable waypoint to achieve continuous loading
        obj_response.script('Waypoint.refreshAll()')
        obj_response.script('Waypoint.enableAll()')
    else:
        obj_response.html('#load_more_container', more_posts_panel(group, name, None).unescape())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号