Ticket #3575: 3575-upper.patch
File 3575-upper.patch, 2.2 KB (added by , 17 years ago) |
---|
-
django/db/backends/postgresql/base.py
60 60 return iter(self.cursor) 61 61 62 62 class DatabaseFeatures(BaseDatabaseFeatures): 63 pass # This backend uses all the defaults.63 needs_upper_for_iops = True 64 64 65 65 class DatabaseWrapper(BaseDatabaseWrapper): 66 66 features = DatabaseFeatures() 67 67 ops = DatabaseOperations() 68 68 operators = { 69 69 'exact': '= %s', 70 'iexact': ' ILIKE %s',70 'iexact': '= UPPER(%s)', 71 71 'contains': 'LIKE %s', 72 'icontains': ' ILIKE %s',72 'icontains': 'LIKE UPPER(%s)', 73 73 'regex': '~ %s', 74 74 'iregex': '~* %s', 75 75 'gt': '> %s', … … 78 78 'lte': '<= %s', 79 79 'startswith': 'LIKE %s', 80 80 'endswith': 'LIKE %s', 81 'istartswith': ' ILIKE %s',82 'iendswith': ' ILIKE %s',81 'istartswith': 'LIKE UPPER(%s)', 82 'iendswith': 'LIKE UPPER(%s)', 83 83 } 84 84 85 85 def _cursor(self, settings): -
django/db/backends/postgresql_psycopg2/base.py
22 22 23 23 class DatabaseFeatures(BaseDatabaseFeatures): 24 24 needs_datetime_string_cast = False 25 needs_upper_for_iops = True 25 26 26 27 class DatabaseOperations(PostgresqlDatabaseOperations): 27 28 def last_executed_query(self, cursor, sql, params): … … 35 36 ops = DatabaseOperations() 36 37 operators = { 37 38 'exact': '= %s', 38 'iexact': ' ILIKE %s',39 'iexact': '= UPPER(%s)', 39 40 'contains': 'LIKE %s', 40 'icontains': ' ILIKE %s',41 'icontains': 'LIKE UPPER(%s)', 41 42 'regex': '~ %s', 42 43 'iregex': '~* %s', 43 44 'gt': '> %s', … … 46 47 'lte': '<= %s', 47 48 'startswith': 'LIKE %s', 48 49 'endswith': 'LIKE %s', 49 'istartswith': ' ILIKE %s',50 'iendswith': ' ILIKE %s',50 'istartswith': 'LIKE UPPER(%s)', 51 'iendswith': 'LIKE UPPER(%s)', 51 52 } 52 53 53 54 def _cursor(self, settings):