1👍
✅
To improve your prefetch, you can do select_related
within TeamMember like this:
from django.db.models import Prefetch
Team.objects.prefetch_related(
Prefetch(
"team_members",
queryset=TeamMembers.objects.select_related("employee__user")
)
)
Source:stackexchange.com