Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)