title: Django Templates First element of a List
body: <p>I pass a dictionary to my Django Template, </p>
  
  <p>Dictionary &amp; Template is like this - </p>
  
  <pre><code>lists[listid] = {'name': l.listname, 'docs': l.userdocs.order_by('-id')}
  
  {% for k, v in lists.items %}
      &lt;ul&gt;&lt;li&gt;Count: {{ v.docs.count }}, First: {{ v.docs|first }}&lt;/li&gt;&lt;/ul&gt;
  {% endfor %}
  </code></pre>
  
  <p>Now <code>docs</code> is a list of <code>userdocs</code> type. i.e. is an instance. So <code>first</code> filter returns me this instance. From this I need to extract it's <code>id</code>. How do I do that?</p>
  
  <p>I tried
  <code>{{ v.docs|first }}.id</code> and various other futile trials.</p>