title: Django - get Foreign Key first object in template
body: <p>I can't get the Foreign Key first object without looping all foreign keys.
  I'm using Django <code>1.10.5</code>.</p>
  
  <p>I have these models:</p>
  
  <pre><code>class Ticket(models.Model):
      ...
  
  class Message(models.Model):
      ticket = models.ForeignKey(Ticket, related_name='messages')
      ...
  
      def __str__(self):
          return self.id
  </code></pre>
  
  <p>And then in the template (DetailView of Ticket) I do:</p>
  
  <pre><code>&lt;p&gt;{{ object.messages.all|first }}&lt;/p&gt;
  &lt;p&gt;{{ object.messages.all.0 }}&lt;/p&gt;
  &lt;p&gt;{{ object.messages.all.1}}&lt;/p&gt;
  {% for message in object.messages.all %}
      &lt;p&gt;{{ message}}&lt;/p&gt;
  {% endfor %}
  </code></pre>
  
  <p>And this prints in the template:</p>
  
  <pre><code>2
  2
  2
  1
  2
  </code></pre>
  
  <p>What is happening?</p>