Bugs item #1460100, was opened at 2006-03-28 19:57
Message generated for change (Comment added) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1460100&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: None
Group: None
>Status: Closed
>Resolution: Works For Me
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Oleg Broytmann (phd)
Summary: orderBy: datetime.datetime cannot be compared with None
Initial Comment:
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"
----------------------------------------------------------------------
>Comment By: Oleg Broytmann (phd)
Date: 2006-11-13 19:55
Message:
Logged In: YES
user_id=4799
I cannot reproduce the problem. The following program works
fine for me.
#! /usr/local/bin/python
from sqlobject import *
__connection__ = "sqlite:/:memory:?debug=1"
class Test(SQLObject):
class sqlmeta:
defaultOrder = "dt"
name = StringCol(default=None)
dt = DateTimeCol(default=None)
from datetime import datetime
Test.createTable()
Test(name="test1")
Test(name="test2", dt=datetime(1967, 12, 21))
Test(dt=datetime(1984, 5, 21))
print list(Test.select())
"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.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1460100&group_id=74338
|