In sqlalchemy there are TIMESTAMP and DATETIME, but I saw these types
will using time.strptime(value, "%Y-%m-%d %H:%M:%S") to convert the
string date. However I had a legacy database, and the date field is
save just like '%Y-%m-%d', so if I use DATETIME it'll be raise
exception:
File
"c:\python24\lib\site-packages\SQLAlchemy-0.91alpha-py2.4.egg\sqlalchemy\databases\sqlite.py",
line 41, in convert_result_value
tup = time.strptime(value, "%Y-%m-%d %H:%M:%S")
File "C:\python24\lib\_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=2005-01-01
fmt=%Y-%m-%d %H:%M:%S
So I want there should be a DATE type. And if I can define the
datetime format is more better.
If I need use user-defined Type to extend that?
--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users