так ладно, решил разобраться.
Построил такой ОРМ:
count_limit = 10
content_type = ContentType.objects.get_for_model(Task)
last_tests = Task.objects.filter(is_active=True).annotate(modified_at=Subquery(
LogEntry.objects.filter(content_type_id=content_type.id, object_id=str(OuterRef('pk')),).order_by(
'-action_time').values('action_time')[:1]
)).order_by('-modified_at')[:count_limit]
Вот его SQL:
SELECT "main_task"."id", "main_task"."lesson_id", "main_task"."name", "main_task"."max_score", "main_task"."content", "main_task"."is_active",
(SELECT U0."action_time"
FROM "django_admin_log" U0
WHERE (U0."content_type_id" = 11 AND U0."object_id" = OuterRef(pk))
ORDER BY U0."action_time" DESC LIMIT 1) AS "modified_at"
FROM "main_task"
WHERE "main_task"."is_active" = True
ORDER BY "modified_at" DESC LIMIT 10
В итоге поле modified_at пустое. Конструкция OuterRef работает вообще?