based on the very generous contributions above.
The problem is that the datetime library includes the datetime class, which is sometimes confused for the uninitiated.
Finish if you run:
import datetime
datetime.date(2011, 1, 1)
You get
>>> datetime.date(2011, 1, 1)
datetime. ,
from datetime import datetime
datetime.date(2011, 1, 1)
>>>TypeError: descriptor 'date' requires a 'datetime.datetime' object but received a 'int'
() datetime datetime, :
datetime.datetime.date(2011, 1, 1)
datetime datetime