I'm always doing this, so some of you must be too. I'll compare a date field in with a datetime object in Python/DJango like this:
if self.start_date < datetime.datetime.now():
and I'll get:
type object 'datetime.datetime' has no attribute 'datetime'Grrrr, this is super-annoying. Of course, it's a simple fix.
if self.start_date < date.today():
Yaaaaayyyyy!
Share on Twitter
Share on Facebook