2👍
threads = Thread.objects.filter(
Q(user1=request.user) | Q(user2=request.user)
).annotate(
latest_msg=Max('message__modified')
).values(
'message__text',
'fields you want to fetch'
).order_by('-latest_msg')[:1]
Source:stackexchange.com