Enhance search functionality with pagination and improve eager loading in utils

This commit is contained in:
Yaro Kasear 2025-06-13 16:16:56 -05:00
parent eb7e446e56
commit cffdc27724
5 changed files with 56 additions and 46 deletions

View file

@ -1,4 +1,4 @@
from sqlalchemy.orm import joinedload
from sqlalchemy.orm import joinedload, selectinload
from .models import User, Room, Inventory, WorkLog
def eager_load_user_relationships(query):
@ -19,8 +19,8 @@ def eager_load_room_relationships(query):
return query.options(
joinedload(Room.area),
joinedload(Room.room_function),
joinedload(Room.inventory),
joinedload(Room.users)
selectinload(Room.inventory),
selectinload(Room.users)
)
def eager_load_worklog_relationships(query):