1👍
✅
Just put all of them in a single .select_related(…)
clause [Django-doc]:
notificationsx = (
notifications.objects.filter(orgid__in=t)
.select_related('task', 'project')
.order_by('-epoch')[:15]
)
Source:stackexchange.com