Example #1
0
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)
Example #2
0
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)
Example #3
0
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)
Example #4
0
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)