Bugs item #1496321, was opened at 2006-05-28 13:44
Message generated for change (Settings changed) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1496321&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: General
Group: SQLObject release (specify)
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Markus Gritsch (markus_gritsch)
Assigned to: Oleg Broytmann (phd)
Summary: Regression in DateTimeValidator
Initial Comment:
The following change in the class DateTimeValidator
leads to different return values:
SQLObject-0.7.0:
secs = time.mktime(stime)
return datetime.datetime.fromtimestamp(secs)
SQLObject-0.7.1b1:
return datetime.datetime(*stime[:7])
I think only the first 6 items of stime should be used
instead of also including the microseconds. When I
change the line to
return datetime.datetime(*stime[:6])
everything works fine again.
----------------------------------------------------------------------
>Comment By: Oleg Broytmann (phd)
Date: 2006-06-14 19:10
Message:
Logged In: YES
user_id=4799
Applied in the revision 1809 to the trunk. Thank you!
----------------------------------------------------------------------
Comment By: Markus Gritsch (markus_gritsch)
Date: 2006-06-12 18:35
Message:
Logged In: YES
user_id=553904
Since the 7th item of stime is the day-of-the-week, the
script below prints out
2006-06-11 00:00:00.000006
wrongly taking the 6th day-of-the-week as the microseconds.
---
import datetime
from sqlobject import *
sqlhub.processConnection = connectionForURI('sqlite:/:memory:')
class Test(SQLObject):
time = DateTimeCol()
Test.createTable()
t = Test(time=datetime.datetime(2006, 6, 11))
print Test.selectBy(id=1)[0].time
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2006-06-07 16:53
Message:
Logged In: YES
user_id=4799
Can you write a short test script that demonstrates the problem?
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2006-06-07 16:49
Message:
Logged In: YES
user_id=4799
Can you write a short test script that demonstrates the problem?
----------------------------------------------------------------------
Comment By: Markus Gritsch (markus_gritsch)
Date: 2006-06-04 20:56
Message:
Logged In: YES
user_id=553904
Additional note: The 7th value is not the micro-seconds, but
the day-of-the-week. So the line should be definitely
changed to the one I suggested.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1496321&group_id=74338
|