This code:
import datetime
d_tomorrow = datetime.date.today() + datetime.timedelta(days=1)
class Model(models.Model):
...
timeout = models.DateTimeField(null=True, blank=True, default=d_tomorrow)
...
resuls in this error:
'datetime.date' object has no attribute 'date'
What am I doing wrong?
Problem solved:
models.DateTimeFieldexpects the value to bedatetime.datetime, notdatetime.date2015 Update:
Arrow makes this all much more straight forward.