Ticket #7464: base.py.patch
File base.py.patch, 986 bytes (added by , 16 years ago) |
---|
-
base.py
6 6 7 7 from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures 8 8 from django.db.backends.postgresql.operations import DatabaseOperations as PostgresqlDatabaseOperations 9 from django.utils.safestring import SafeUnicode 9 from django.utils.safestring import SafeUnicode, SafeString 10 10 try: 11 11 import psycopg2 as Database 12 12 import psycopg2.extensions … … 18 18 IntegrityError = Database.IntegrityError 19 19 20 20 psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) 21 psycopg2.extensions.register_adapter(SafeUnicode, psycopg2.extensions.QuotedString) 21 psycopg2.extensions.register_adapter(SafeUnicode, psycopg2.extensions.UNICODE) 22 psycopg2.extensions.register_adapter(SafeString, psycopg2.extensions.QuotedString) 22 23 23 24 class DatabaseFeatures(BaseDatabaseFeatures): 24 25 needs_datetime_string_cast = False