title: python - django: why am I getting this error: AttributeError: 'method_descriptor' object has no attribute 'today'?
body: <p>I have the following python code:</p>
  
  <pre><code>from django.db import models
  from datetime import datetime
  
  class Poll(models.Model):
      question = models.CharField(max_length=200)
      pub_date = models.DateTimeField('date published')
      def __unicode__(self):
          return self.question
      def was_published_today(self):
          return self.pub_date.date() == datetime.date.today()
  </code></pre>
  
  <p>In a python shell, I am trying to run:</p>
  
  <pre><code>p = Poll.objects.get(pk=1)
  p.was_published_today()
  </code></pre>
  
  <p>The first line works fine but the second line gives me this error:  </p>
  
  <p><strong>AttributeError: 'method_descriptor' object has no attribute 'today'</strong></p>