From 39120993cc94dd210857ea0a0515eea2dc35d210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?X=C3=A9fir=20Destiny?= Date: Sun, 15 Dec 2019 20:29:19 +0100 Subject: [PATCH] Sort ?? --- app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 4b4bd54..d1102be 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,4 @@ -from operator import itemgetter +from operator import attrgetter, itemgetter from flask import redirect, render_template, request, url_for @@ -100,6 +100,8 @@ def list_animes(): @auth.login_required def admin(): folders = AnimeFolder.query.all() + for folder in folders: + folder.titles.sort(key=attrgetter('name')) form = DeleteForm(request.form) if form.validate_on_submit():