title: Annotate with latest related object in Django
body: <p>I have a model <code>Conversation</code> and a model <code>Message</code>.</p>
  
  <p>The model <code>Message</code> has a foreign key to conversation, a text field, and a date field.</p>
  
  <p>How can I list all conversations and for each conversation get the most recent message and the date of the most recent message?</p>
  
  <p>I guess it's something like</p>
  
  <pre><code>Conversation.objects.annotate(last_message=Max('messages__date'))
  </code></pre>
  
  <p>but it will only give me the latest date. I want <code>last_message</code> to contain both the text of the last message and the date it was created. Maybe I need to use prefetch_related?</p>