title: Custom Filter in Django Admin on Django 1.3 or below
body: <p>How can I add a custom filter to django admin (the filters that appear on the right side of a model dashboard)?  I know its easy to include a filter based on a field of that model, but what about a "calculated" field like this:</p>
  
  <pre><code>class NewsItem(models.Model):
      headline = models.CharField(max_length=4096, blank=False)
      byline_1 = models.CharField(max_length=4096, blank=True)
      dateline = models.DateTimeField(help_text=_("date/time that appears on article"))
      body_copy = models.TextField(blank=False)
  
      when_to_publish = models.DateTimeField(verbose_name="When to publish",  blank=True, null=True)
  
      # HOW CAN I HAVE "is_live" as part of the admin filter?  It's a calculated state!!
      def is_live(self):
          if self.when_to_publish is not None:
              if ( self.when_to_publish &lt; datetime.now() ):
                  return """ &lt;img alt="True" src="/media/img/admin/icon-yes.gif"/&gt; """
          else:
              return """ &lt;img alt="False" src="/media/img/admin/icon-no.gif"/&gt; """      
  
      is_live.allow_tags = True
  </code></pre>
  
  <hr>
  
  <pre><code>class NewsItemAdmin(admin.ModelAdmin):
      form = NewsItemAdminForm
      list_display = ('headline', 'id', 'is_live')
      list_filter = ('is_live')  #  how can i make this work??
  </code></pre>