When datetime.datetime is used for DateTimeCols:
Using defaultOrder with a DateTimeCol fails when there
is an empty DateTimeCol (None). This does not happen
with the mx modules.
"can't compare datetime.time to NoneType"
Logged In: YES
I cannot reproduce the problem. The following program works
fine for me.
from sqlobject import *
__connection__ = "sqlite:/:memory:?debug=1"
defaultOrder = "dt"
name = StringCol(default=None)
dt = DateTimeCol(default=None)
from datetime import datetime
Test(name="test2", dt=datetime(1967, 12, 21))
Test(dt=datetime(1984, 5, 21))
"can't compare datetime.time to NoneType" raised if one
tries to list(Test.select()).sort(key=attrgetter("dt")), but
that's not an SQLObject-related problem.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.