Skip to content

Commit f394e31

Browse files
authored
Merge pull request #8 from CampusPulse/Alphabetical-Catalog
Getting catalog items now ordered by Building name, Location name
2 parents 0f8ee03 + 45a230e commit f394e31

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
@@ -362,8 +362,10 @@ def getAccessPointsPaginated(page_num):
362362
access_point_json,
363363
db.session.execute(
364364
db.select(AccessPoint)
365+
.join(Location, AccessPoint.location_id == Location.id)
366+
.join(Building, Location.building_id == Building.id)
365367
.where(AccessPoint.active)
366-
.order_by(AccessPoint.id.asc())
368+
.order_by(Building.name.asc(), Location.nickname.asc())
367369
.offset(page_num * app.config["ITEMSPERPAGE"])
368370
.limit(app.config["ITEMSPERPAGE"])
369371
).scalars(),

0 commit comments

Comments
 (0)