title: Django Get Latest Entry from Database
body: <p>I've got 2 questions, but they are related to the same topic.</p>
  
  <p>I know how to retrieve data from a <code>for loop</code> using template tags</p>
  
  <pre><code>{% for status in status %}
  
      &lt;tr&gt;
          &lt;td&gt;{{ status.status}}&lt;/td&gt;
      &lt;/tr&gt;
  
  {% endfor %}
  </code></pre>
  
  <p>However when I want to retrieve a single object i get an error even when i use:</p>
  
  <pre><code>po = Status.objects.latest('id')
  </code></pre>
  
  <p>and remove the for loop.</p>
  
  <p>I get:</p>
  
  <pre><code>'Status' object is not iterable
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li>How can I get the latest entry from the database for a given model?</li>
  <li>How can I setup my templates tags to allow for just a single record?</li>
  </ol>