On Monday 12 Oct 2009 11:05:38 am Denis Bahati wrote: > 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() > def was_published_today(self): > return self.pub_date.date() == datetime.date.today() > was_published_today.short_description = 'Published today?'
please learn some python! 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() def was_published_today(self): return self.pub_date.date() == datetime.date.today() -- regards kg http://lawgon.livejournal.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---