tutorial #02 -
|Reported by:||anon_who_is_annoyed_by_spam_filter||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
def was_published_today(self): return self.pub_date.date() == datetime.date.today()
This baffled me for some time - after adding anything I got false. The problem was with time zones - Django's settings.py had another time zone.
I would add a small comment in the documentation, or change datetime.date.today() to some function which respects time zone in settings.py.