Im using Mysqldb with Python(2.7) to return a bunch of values form a Mysql database with a charset latin1.
The mysql database has values of type bit(1) when these are returned they look like this '\x01'
Decimal values return like this Decimal('0E-8')
They rest of the values and types are fine.
Sample Database resultset:
{'test': '\x01', 'currency': u'bla', 'balance': Decimal('0E-8'), 'first': u'John'}
This is how im connecting to the database: self.con = MySQLdb.connect(host = conn['host'], user = conn['user'], passwd=conn['passwd'], db=conn['db'], charset=conn['charset'],port = int(conn['port']) if 'port' in conn else 3306)
I would like the bit(1) values to be return as either True or False. I have looked around and I think it might be to do MySQLdb.converters.conversions but im not sure how to implement this. Any ideas would be great. Thanks
And I don't have access to change the types in the DB.