forked from MarseyWorld/MarseyWorld
sort hats by price then alphabetically
parent
de9f9ab11c
commit
f92a33fb04
|
@ -11,8 +11,8 @@ def hats(v):
|
||||||
if not FEATURES['HATS']: abort(404)
|
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_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()
|
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).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)
|
return render_template("hats.html", owned=owned, not_owned=not_owned, v=v)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue