def index(page): # Return all articles and display them in the index template num_posts = model.count_articles() pagination = Pagination(page, num_posts) articles = model.get_articles(page) return render_template('index.html', articles=articles, pagination=pagination)
def list(tag, page): # List all articles for a given tag and display them num_posts = model.count_articles(tag) articles = model.get_articles(page, tag=tag) return render_template('list.html', articles=articles)