title: Get an attribute of the last record in a django model filtering by user id
body: <p>I'm trying to get the attribute &quot;query&quot; of the last record in a django model called &quot;conversation&quot; filtering by user id.
  I used this code but it didn't work :</p>
  <pre class="lang-py prettyprint-override"><code>if Conversation.objects.filter(user=request.user, query='question').last:
      ...
  </code></pre>
  <p>and</p>
  <pre class="lang-py prettyprint-override"><code>if Conversation.objects.filter(user=request.user).last.query = 'question':
      ...
  </code></pre>
  <p>the conversation model :</p>
  <pre class="lang-py prettyprint-override"><code>class Conversation(models.Model):
      user = models.ForeignKey(User, on_delete=models.PROTECT)
      query = models.TextField()
      response = models.TextField()
  
      def __unicode__(self):
          return self.query
  
      def save(self, *args, **kwargs):
          super().save()
  </code></pre>
  <p>Please help me through that and thanks in advance</p>