summaryrefslogtreecommitdiff
path: root/db.py
diff options
context:
space:
mode:
authorAdrien Di Mascio <adim@logilab.fr>2006-05-19 11:46:11 +0200
committerAdrien Di Mascio <adim@logilab.fr>2006-05-19 11:46:11 +0200
commit4a7809bf0403a3e5a97c9dd4b18f2376cc89678a (patch)
tree7044ad3961ce064a91acd3db5ddac40272d955dd /db.py
parent2c01bbd132fd7f74c247519c75998d40dccaadc8 (diff)
downloadlogilab-common-4a7809bf0403a3e5a97c9dd4b18f2376cc89678a.tar.gz
mx time support in sqlite
Diffstat (limited to 'db.py')
-rw-r--r--db.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/db.py b/db.py
index 8f3c621..c46e7af 100644
--- a/db.py
+++ b/db.py
@@ -265,6 +265,11 @@ class _PySqlite2Adapter(DBAPIAdapter):
return strptime(ustr, '%F %H:%M:%S')
sqlite.register_converter('timestamp', convert_mxdatetime)
+ def convert_mxtime(ustr):
+ return strptime(ustr, '%H:%M')
+ sqlite.register_converter('time', convert_mxtime)
+
+
def adapt_bytea(data):
return data.getvalue()
sqlite.register_adapter(StringIO, adapt_bytea)