Skip to content

Commit 45a230e

Browse files
committed
Getting catalog items now ordered by Building name, Location name
1 parent ed39491 commit 45a230e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,10 @@ def getAccessPointsPaginated(page_num):
363363
access_point_json,
364364
db.session.execute(
365365
db.select(AccessPoint)
366+
.join(Location, AccessPoint.location_id == Location.id)
367+
.join(Building, Location.building_id == Building.id)
366368
.where(AccessPoint.active)
367-
.order_by(AccessPoint.id.asc())
369+
.order_by(Building.name.asc(), Location.nickname.asc())
368370
.offset(page_num * app.config["ITEMSPERPAGE"])
369371
.limit(app.config["ITEMSPERPAGE"])
370372
).scalars(),

0 commit comments

Comments
 (0)