Simplified SQLite converter for bool type.

This commit is contained in:
Sergey Fedoseev 2017-12-13 08:40:15 +05:00 committed by Tim Graham
parent da71e4bb08
commit f9a0766f1c
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ def decoder(conv_func):
return lambda s: conv_func(s.decode()) return lambda s: conv_func(s.decode())
Database.register_converter("bool", lambda s: s == b'1') Database.register_converter("bool", b'1'.__eq__)
Database.register_converter("time", decoder(parse_time)) Database.register_converter("time", decoder(parse_time))
Database.register_converter("date", decoder(parse_date)) Database.register_converter("date", decoder(parse_date))
Database.register_converter("datetime", decoder(parse_datetime)) Database.register_converter("datetime", decoder(parse_datetime))