Ticket #7921: sqlite3-str.diff
File sqlite3-str.diff, 902 bytes (added by , 16 years ago) |
---|
-
django/db/backends/sqlite3/base.py
37 37 Database.register_converter("TIMESTAMP", util.typecast_timestamp) 38 38 Database.register_converter("decimal", util.typecast_decimal) 39 39 Database.register_adapter(decimal.Decimal, util.rev_typecast_decimal) 40 if Database.version_info >= (2,4,1): 41 # Starting in 2.4.1, the str type is not accepted anymore, therefore, 42 # we convert all str objects to Unicode 43 # As registering a adapter for a primitive type causes a small 44 # slow-down, this adapter is only registered for sqlite3 versions 45 # needing it. 46 Database.register_adapter(str, lambda s:s.decode('utf-8')) 40 47 41 48 class DatabaseFeatures(BaseDatabaseFeatures): 42 49 supports_constraints = False