Ticket #12583: postgres_typecast_fix_and_test.diff
File postgres_typecast_fix_and_test.diff, 2.6 KB (added by , 15 years ago) |
---|
-
django/db/backends/postgresql/base.py
71 71 class DatabaseWrapper(BaseDatabaseWrapper): 72 72 operators = { 73 73 'exact': '= %s', 74 'iexact': '= UPPER(%s )',75 'contains': 'LIKE %s ',76 'icontains': 'LIKE UPPER(%s )',74 'iexact': '= UPPER(%s::text)', 75 'contains': 'LIKE %s::text', 76 'icontains': 'LIKE UPPER(%s::text)', 77 77 'regex': '~ %s', 78 78 'iregex': '~* %s', 79 79 'gt': '> %s', 80 80 'gte': '>= %s', 81 81 'lt': '< %s', 82 82 'lte': '<= %s', 83 'startswith': 'LIKE %s ',84 'endswith': 'LIKE %s ',85 'istartswith': 'LIKE UPPER(%s )',86 'iendswith': 'LIKE UPPER(%s )',83 'startswith': 'LIKE %s::text', 84 'endswith': 'LIKE %s::text', 85 'istartswith': 'LIKE UPPER(%s::text)', 86 'iendswith': 'LIKE UPPER(%s::text)', 87 87 } 88 88 89 89 def __init__(self, *args, **kwargs): -
django/db/backends/postgresql_psycopg2/base.py
44 44 class DatabaseWrapper(BaseDatabaseWrapper): 45 45 operators = { 46 46 'exact': '= %s', 47 'iexact': '= UPPER(%s )',48 'contains': 'LIKE %s ',49 'icontains': 'LIKE UPPER(%s )',47 'iexact': '= UPPER(%s::text)', 48 'contains': 'LIKE %s::text', 49 'icontains': 'LIKE UPPER(%s::text)', 50 50 'regex': '~ %s', 51 51 'iregex': '~* %s', 52 52 'gt': '> %s', 53 53 'gte': '>= %s', 54 54 'lt': '< %s', 55 55 'lte': '<= %s', 56 'startswith': 'LIKE %s ',57 'endswith': 'LIKE %s ',58 'istartswith': 'LIKE UPPER(%s )',59 'iendswith': 'LIKE UPPER(%s )',56 'startswith': 'LIKE %s::text', 57 'endswith': 'LIKE %s::text', 58 'istartswith': 'LIKE UPPER(%s::text)', 59 'iendswith': 'LIKE UPPER(%s::text)', 60 60 } 61 61 62 62 def __init__(self, *args, **kwargs): -
tests/regressiontests/queries/models.py
1220 1220 >>> subq._result_cache is None 1221 1221 True 1222 1222 1223 # Regression test for #12583: 1224 >>> Tag(name="4").save() 1225 >>> Tag.objects.filter(name__iexact=4) 1226 [<Tag: 4>] 1227 1223 1228 """} 1224 1229 1225 1230 # In Python 2.3 and the Python 2.6 beta releases, exceptions raised in __len__