From 149b43a0137f04172d591bd328b485788e70f3a8 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 24 May 2018 20:27:42 +0100 Subject: [PATCH] Limit packages on home page and sort by creation date descending --- app/views/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/__init__.py b/app/views/__init__.py index 924dc67f..28fb518c 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -43,7 +43,7 @@ def send_upload(path): @app.route("/") @menu.register_menu(app, ".", "Home") def home_page(): - packages = Package.query.filter_by(approved=True).all() + packages = Package.query.filter_by(approved=True).order_by(db.desc(Package.created_at)).limit(15).all() return render_template("index.html", packages=packages) from . import users, githublogin, packages, sass, tasks, admin, notifications