Commit 9a8cefef authored by Aurel's avatar Aurel

manage bit columns

parent 4d3c1f0c
...@@ -166,6 +166,10 @@ def int_or_long(s): ...@@ -166,6 +166,10 @@ def int_or_long(s):
try: return int(s) try: return int(s)
except: return long(s) except: return long(s)
def ord_or_None(s):
if s is not None:
return ord(s)
class ThreadedDB: class ThreadedDB:
""" """
This class is an interface to DB. This class is an interface to DB.
...@@ -178,6 +182,7 @@ class ThreadedDB: ...@@ -178,6 +182,7 @@ class ThreadedDB:
conv[FIELD_TYPE.DATETIME] = DateTime_or_None conv[FIELD_TYPE.DATETIME] = DateTime_or_None
conv[FIELD_TYPE.DATE] = DateTime_or_None conv[FIELD_TYPE.DATE] = DateTime_or_None
conv[FIELD_TYPE.DECIMAL] = float conv[FIELD_TYPE.DECIMAL] = float
conv[FIELD_TYPE.BIT] = ord_or_None
del conv[FIELD_TYPE.TIME] del conv[FIELD_TYPE.TIME]
def __init__(self,connection): def __init__(self,connection):
......
...@@ -164,6 +164,10 @@ def int_or_long(s): ...@@ -164,6 +164,10 @@ def int_or_long(s):
try: return int(s) try: return int(s)
except: return long(s) except: return long(s)
def ord_or_None(s):
if s is not None:
return ord(s)
class ThreadedDeferredDB: class ThreadedDeferredDB:
""" """
An experimental MySQL DA which implements deferred execution An experimental MySQL DA which implements deferred execution
...@@ -176,6 +180,8 @@ class ThreadedDeferredDB: ...@@ -176,6 +180,8 @@ class ThreadedDeferredDB:
conv[FIELD_TYPE.DATETIME] = DateTime_or_None conv[FIELD_TYPE.DATETIME] = DateTime_or_None
conv[FIELD_TYPE.DATE] = DateTime_or_None conv[FIELD_TYPE.DATE] = DateTime_or_None
conv[FIELD_TYPE.DECIMAL] = float conv[FIELD_TYPE.DECIMAL] = float
conv[FIELD_TYPE.BIT] = ord_or_None
del conv[FIELD_TYPE.TIME] del conv[FIELD_TYPE.TIME]
def __init__(self,connection): def __init__(self,connection):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment