title: Django: drop-down list
body: <p>I have a model 'Post,' which is just a like a blog post:</p>
  
  <pre><code>class Post(models.Model):
  </code></pre>
  
  <p>Each post has a pub_date attribute:</p>
  
  <pre><code>pub_date = models.DateField()
  </code></pre>
  
  <p>When displaying posts on my site, I'd like to have an simple, drop-down menu at the top of the page with a structure like:</p>
  
  <ul>
  <li>2014
  <ul>
  <li>Jan</li>
  <li>Feb</li>
  </ul></li>
  <li>2013</li>
  <li>2012</li>
  </ul>
  
  <p>and so on. I can't figure out how to sort my posts like this with Django, and I think it would be bad practice to hard code it. How would you solve this?</p>