From f92a33fb04c6c611dc6b3035cb98c33f1cacef65 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 3 Sep 2022 02:29:54 +0200 Subject: [PATCH] sort hats by price then alphabetically --- files/routes/hats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/hats.py b/files/routes/hats.py index 151bfd84c..b6b2f83cf 100644 --- a/files/routes/hats.py +++ b/files/routes/hats.py @@ -11,8 +11,8 @@ def hats(v): if not FEATURES['HATS']: abort(404) owned_hats = [x[0] for x in g.db.query(Hat.hat_id).filter_by(user_id=v.id).all()] - owned = g.db.query(HatDef, User).join(HatDef.author).filter(HatDef.id.in_(owned_hats)).order_by(HatDef.price).all() - not_owned = g.db.query(HatDef, User).join(HatDef.author).filter(HatDef.id.notin_(owned_hats)).order_by(HatDef.price).all() + owned = g.db.query(HatDef, User).join(HatDef.author).filter(HatDef.id.in_(owned_hats)).order_by(HatDef.price, HatDef.name).all() + not_owned = g.db.query(HatDef, User).join(HatDef.author).filter(HatDef.id.notin_(owned_hats)).order_by(HatDef.price, HatDef.name).all() return render_template("hats.html", owned=owned, not_owned=not_owned, v=v)