def list_by_tag(tag): blog_posts = BlogPost.query_by_tag(tag) if len(blog_posts) == 0: print('No file was found by tag: %s!' % tag) for blog in blog_posts: print(blog_posts.index(blog)) blog.print()
def list_all_by_tag(tag, page='1'): all_blog_posts = BlogPost.query_by_tag(tag) current_page_info = Page_Info.create(page, all_blog_posts) template = TEMPLATE_ENV.get_template('home.html') return template.render(post_list=current_page_info.data, page_info=current_page_info)