Re: [SQLObject] That date validator bug...
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ma...> - 2006-05-25 16:15:57
|
On Thu, May 25, 2006 at 05:04:20PM +0100, Fadhley, Salim (FID) wrote: > That value came from sybase! > > Look at the function to_python in col.py - it turns whatever data format > the DB uses to represent a date into a datetime object. It works fine as > long as the DB ises ISOFormat. If for some reason the DB is > misconfigured then it fails. > > > On Thu, May 25, 2006 at 04:41:37PM +0100, Fadhley, Salim (FID) wrote: > > > (Pdb) value > > > 'Jun 20 2007 12:00AM' > > > (Pdb) Format mismatch causes ValueError: >>> import time >>> time.strptime("21/12/06", "%Y-%m-%d") Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.4/_strptime.py", line 293, in strptime raise ValueError("time data did not match format: data=%s fmt=%s" % ValueError: time data did not match format: data=21/12/06 fmt=%Y-%m-%d IIRC your traceback the problem was not in value (not ValueError) but in type (TypeError). The value is not a string. But what is it? Can you print type(value)? Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |