From f8ee6f741ea1c96fe0ec2dd8ec4b311fe6973c6e Mon Sep 17 00:00:00 2001 From: jieun Date: Tue, 4 Apr 2017 17:41:55 -0400 Subject: [PATCH] edit /allposts page so that it shows only the 3 *most recent* posts --- app/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views.py b/app/views.py index 17a8682..d5987ab 100644 --- a/app/views.py +++ b/app/views.py @@ -82,7 +82,7 @@ def index(page=1): @app.route('/allposts', methods=['GET', 'POST']) def allposts(): form = PostForm() - posts = Post.query.limit(3) + posts = Post.query.order_by(Post.timestamp.desc()).limit(3) return render_template('allposts.html', title='allposts', form=form,