sort hats by price then alphabetically

master
Aevann1 2022-09-03 02:29:54 +02:00
parent de9f9ab11c
commit f92a33fb04
1 changed files with 2 additions and 2 deletions

View File

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