Let's assume I've the classic blog Post
with multiple related Comment
s model.
I'm trying to get a list of posts each annotated with its last comment
(or at least a single field from it).
The closest I've gotten is via:
Post.objects.annotate(last_comment=F('comment__text'))
But this just returns the body for the first commend, and I explicitly want the last.
Am I missing something pretty obvious? Or is there some smart way of doing this that I'm failing to see?