Limit packages on home page and sort by creation date descending

This commit is contained in:
rubenwardy 2018-05-24 20:27:42 +01:00
parent 6012af6855
commit 149b43a013
No known key found for this signature in database
GPG Key ID: A1E29D52FF81513C

@ -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